-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (29 loc) · 812 Bytes
/
Dockerfile
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
36
37
38
39
40
41
42
43
44
# -------------------
# Development stage
# -------------------
FROM python:3.12-slim AS dev
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install
COPY src/ ./src/
CMD ["poetry", "run", "python", "src/your_main_script.py"]
# -------------------
# Stage stage (for testing)
# -------------------
FROM python:3.12-slim AS stage
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-dev
COPY src/ ./src/
CMD ["python", "src/your_main_script.py"]
# -------------------
# Deploy stage (production-ready)
# -------------------
FROM python:3.12-slim AS deploy
WORKDIR /app
COPY --from=stage /app/ .
CMD ["python", "src/your_main_script.py"]