approvers / OreOreBot2

限界開発鯖を代表する BOT はらちょ を TypeScript+discord.js で作り直し。 オレオレ BOT です。別に詐欺とかはしません。
https://haracho.approvers.dev
MIT License
13 stars 2 forks source link

build: Dockerイメージのサイズを最適化 #1112

Closed MikuroXina closed 11 months ago

MikuroXina commented 12 months ago

Resolves #1059.

Type of Change:

ビルド構成の修正

Cause of the Problem (問題の原因)

特定のサブパッケージしか使わないのに, インストールを yarn install --immutable で行っていたのが間違いでした.

Details of implementation (実施内容)

コピーしてくるソースコードをボットのものだけにしました. そして, Workspaces コマンドの 1 つである, 特定のサブパッケージでのみインストールを実行する focus コマンドによりインストール時の lock ファイルに関するエラーを解消しました.

これによりイメージのサイズを 520MB まで減らしました.

Additional Information (追加情報)

ベースイメージは distroless よりもこのままの方が全体のイメージサイズは小さくなるようです.

github-actions[bot] commented 12 months ago

Hadolint: success

codecov[bot] commented 12 months ago

Codecov Report

Merging #1112 (b3745d6) into main (05a61b7) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1112   +/-   ##
=======================================
  Coverage   72.57%   72.57%           
=======================================
  Files          80       80           
  Lines        5484     5484           
  Branches      487      487           
=======================================
  Hits         3980     3980           
  Misses       1018     1018           
  Partials      486      486           
Flag Coverage Δ
unittests 72.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

cloudflare-workers-and-pages[bot] commented 11 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b3745d6
Status:⚡️  Build in progress...

View logs

github-actions[bot] commented 11 months ago

Hadolint: success