Git Product home page Git Product logo

docker-goa-next's Introduction

Hello!

🚀 𝗠𝘆 𝗧𝗲𝗰𝗸 𝗦𝘁𝗮𝗰𝗸

go JavaScript TypeScript React Next.js Ruby Rails PHP Laravel

nginx redis Mysql webpack Eslint Prettier Tailwind CSS Sass MaterilUI Bootstrap

git github actions AWS CloundFormation Terraform Firebase Vercel Docker Visual Stduio Code Vim Linux

⚡ 𝗦𝘁𝗮𝘁𝘀

trophy

Top Langs github stats

docker-goa-next's People

Contributors

dependabot[bot] avatar kod-source avatar

Watchers

 avatar

docker-goa-next's Issues

go-jwtをアップデートする

jwt-go allows attackers to bypass intended access restrictions in situations with []string{} for m["aud"] (which is allowed by the specification). Because the type assertion fails, "" is the value of aud. This is a security problem if the JWT token is presented to a service that lacks its own audience check. There is no patch available and users of jwt-go are advised to migrate to [golang-jwt](https://github.com/golang-jwt/jwt) at version 3.2.1

Dependabotに↑のように怒られているので、アップデートする。
↓を使うといい
https://github.com/golang-jwt/jwt

DockerのBuild時間を短縮したい

こちらを参考にDockerのBuild時間を短縮したい

具体的には下記のことをやる

  • Docker Daemonへの転送ファイル削減
    • Build Contextはビルドに必要なファイルを含む最も深い階層(ディレクトリ)に指定する
    • Build Contextとするディレクトリに.dockerignoreファイルを設置して.gitやnode_modules、テスト用ファイルやビルド結果ファイル群などを記述して転送対象から除外する
  • cacheの有効活用

Dockerファイルのアンチパターン例

FROM node:10.19.0-alpine
WORKDIR /usr/src/app
COPY . .
RUN npm install
CMD [ "npm", "start" ]

この場合、 package*.json 以外のアプリケーション部分(最も頻繁に変更する部分)を含むCOPYの後に npm install をする為、 package*.jsonに変更が無くても以下の様にCOPYステートメントでcacheが使われず、 npm install も実行されてしまいます。

良い例

FROM node:10.19.0-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
CMD [ "npm", "start" ]

こちらは、 npm install は直前のCOPYの変更がなければcacheを使う事ができ、 package*.json の更新があった場合に限定する事ができます。以下の様にsrc/index.tsの変更であればcacheが適用されます。

[API]テストの並行実行を試してみる

こちらを参考にしながたテストの並行実行を行なってみる。
特にDBの処理は時間がかかるので上手いことやって時短につなげたい。

↑の記事の結論

  • サブテスト関数が、さらにネストしたt.Run()メソッドによるサブサブテスト関数を含んでいなければ、defer文あるいはt.Cleanup()メソッドのどちらで後処理を記述してもよい。
  • サブテスト関数が、さらにネストしたt.Run()メソッドによるサブサブテスト関数を含んでいて、そのすべてのサブサブテスト関数がt.Parallel()メソッドを呼び出していない場合、defer文あるいはt.Cleanup()メソッドのどちらで後処理を記述してもよい。
  • サブテスト関数が、さらにネストしたt.Run()メソッドによるサブサブテスト関数を含んでいて、少なくとも一つのサブサブテスト関数がt.Parallel()メソッドを呼び出している場合、t.Cleanup()メソッドで後処理を記述する。

つまり

  • 並行力を一番最大限にするにはトップレベルのテスト関数とその中のサブテスト関数の両方でt.Parallel()を呼び出す必要がある。
  • t.Parallel()を使用したらt.Cleanup()で後処理するのが無難

go generateでエラーが出る

google/wireを導入したらgo generate ./...でエラーを吐くようになりました。
原因調査と解決したいです

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.