From ffa7dda493a1c2da4d478cc5d0c9111488e00cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AF=BC=ED=97=8C?= Date: Mon, 6 Jul 2026 11:16:45 +0900 Subject: [PATCH] =?UTF-8?q?fix(anchoring):=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EC=97=90=20config.toml=20=EB=AF=B8=ED=8F=AC=ED=95=A8=20?= =?UTF-8?q?=E2=80=94=20=EB=9F=B0=ED=83=80=EC=9E=84=20=EB=A7=88=EC=9A=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=A0=84=ED=99=98=C2=B7.dockerignore=20=EC=8B=A0?= =?UTF-8?q?=EC=84=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dockerfile 의 COPY config.toml* 제거: 실 시크릿이 이미지 레이어에 구워지는 문제 해소 - .dockerignore 신설로 빌드 컨텍스트에서도 config.toml 차단(이중 방어) - docker-compose 가 ./config.toml 을 읽기 전용 마운트 — up 전에 파일이 있어야 함 (없으면 docker 가 디렉터리를 생성해 기동 실패 — 주석·런북에 명시) - 설정 변경 반영이 리빌드 없이 restart 로 단순화 Co-Authored-By: Claude Fable 5 --- schedules/anchoring/.dockerignore | 11 +++++++++++ schedules/anchoring/Dockerfile | 2 +- schedules/anchoring/docker-compose.yml | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 schedules/anchoring/.dockerignore diff --git a/schedules/anchoring/.dockerignore b/schedules/anchoring/.dockerignore new file mode 100644 index 0000000..6a5ed5a --- /dev/null +++ b/schedules/anchoring/.dockerignore @@ -0,0 +1,11 @@ +# 시크릿 — 이미지 레이어에 절대 넣지 않는다(런타임 마운트/env 주입) +config.toml +config.*.toml + +__pycache__/ +*.pyc +.pytest_cache/ +.venv/ +tests/ +docs/ +*.md diff --git a/schedules/anchoring/Dockerfile b/schedules/anchoring/Dockerfile index 7e7f156..866a44f 100644 --- a/schedules/anchoring/Dockerfile +++ b/schedules/anchoring/Dockerfile @@ -5,8 +5,8 @@ WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# config.toml 은 이미지에 넣지 않는다(시크릿이 이미지 레이어에 남음) — 런타임 마운트 또는 env 로 주입 COPY src ./src -COPY config.toml* ./ ENV PYTHONPATH=/app/src \ PYTHONUNBUFFERED=1 diff --git a/schedules/anchoring/docker-compose.yml b/schedules/anchoring/docker-compose.yml index de276b1..d414f9f 100644 --- a/schedules/anchoring/docker-compose.yml +++ b/schedules/anchoring/docker-compose.yml @@ -24,6 +24,10 @@ services: DB_HOST: host.docker.internal REDIS_HOST: anchoring-redis TZ: Asia/Seoul + volumes: + # config.toml(시크릿)은 이미지에 안 굽고 런타임 마운트 — 없으면 파일을 먼저 만들 것 + # (cp config.toml.example config.toml — 없이 up 하면 docker 가 디렉터리를 만들어 기동 실패) + - ./config.toml:/app/config.toml:ro depends_on: - anchoring-redis restart: unless-stopped