-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 826 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
# temp stage
FROM python:3.12-slim AS builder
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc curl
# Install python dependencies
COPY pyproject.toml .
COPY poetry.lock .
RUN curl -sSL https://install.python-poetry.org | python3 - && \
pip install --upgrade pip && \
pip install poetry && \
poetry install
COPY . .
# final stage
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends curl
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /app .
ENTRYPOINT ["./entrypoint.sh"]