Skip to content

build:加入 .dockerignore #352

Description

@as535364

What to build

production stage 直接 `COPY ./ /app`,目前發佈映像會夾帶 tests、.github,CI 環境下還有 .git;本機建置更會吸進 .venv、minio 資料與 logs,撐大 build context,且任何 log 寫入都會讓 COPY 層 cache 失效。

新增 .dockerignore,排除版本控制、測試、覆蓋率報告、虛擬環境、資料與快取目錄。注意不可排除 pyproject.toml 與 poetry.lock(builder stage 需要 COPY 它們)。

這會改變發佈映像的內容(tests 移除)——runtime 沒有任何程式 import tests,改動由 #350 的 PR docker build job 在 merge 前驗證。

Acceptance criteria

  • PR 的 docker build job 綠
  • 建出的映像內不含 tests 目錄與 .git

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions