-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 820 Bytes
/
Dockerfile
File metadata and controls
35 lines (23 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# TESTER
FROM python:3.12-alpine AS tester
RUN ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
RUN echo Asia/Seoul > /etc/timezone
WORKDIR /app
COPY src ./src
COPY pyproject.toml poetry.lock README.md ./
RUN pip install poetry
RUN poetry config virtualenvs.in-project true
RUN poetry config virtualenvs.path "./.venv"
RUN poetry install
ENTRYPOINT ["poetry", "run", "pytest", "/app/src/tests", "-v"]
# RUNNER
FROM python:3.12-alpine AS runner
RUN ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
RUN echo Asia/Seoul > /etc/timezone
WORKDIR /app
COPY --from=tester /app .
RUN pip install poetry
RUN poetry config virtualenvs.in-project true
RUN poetry config virtualenvs.path "./.venv"
RUN poetry install
ENTRYPOINT ["poetry", "run", "uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "8080"]