Skip to content

Commit 54fee2d

Browse files
ImTotemclaude
andcommitted
feat(infra): add Dockerfile for API container
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 978e1c4 commit 54fee2d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

infra/docker/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.12-slim AS deps
2+
3+
WORKDIR /build
4+
COPY pyproject.toml .
5+
RUN mkdir -p src/bcsd_api && touch src/bcsd_api/__init__.py && \
6+
pip install --no-cache-dir .
7+
8+
FROM python:3.12-slim
9+
10+
RUN groupadd -r app && useradd -r -g app app
11+
12+
ENV TZ=Asia/Seoul
13+
14+
WORKDIR /app
15+
16+
COPY --from=deps /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
17+
COPY --from=deps /usr/local/bin /usr/local/bin
18+
19+
COPY pyproject.toml .
20+
COPY src/ src/
21+
RUN pip install --no-cache-dir --no-deps .
22+
23+
USER app
24+
25+
EXPOSE 8000
26+
27+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
28+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/openapi.json')"
29+
30+
CMD ["uvicorn", "bcsd_api.main:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)