-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.07 KB
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
45
FROM python:3.12-slim AS py_deps
WORKDIR /api
RUN apt-get update && apt-get install -y \
git \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY api/pyproject.toml .
COPY api/poetry.lock .
RUN python -m pip install poetry==2.0.1 --no-cache-dir && \
poetry config keyring.enabled false && \
poetry config virtualenvs.create true --local && \
poetry config virtualenvs.in-project true --local && \
poetry config virtualenvs.options.always-copy --local true && \
POETRY_MAX_WORKERS=1 poetry install --no-interaction --no-ansi --only main && \
poetry cache clear --all .
FROM python:3.12-slim
RUN apt-get update && apt-get install -y \
curl \
gnupg \
git \
ca-certificates \
&& apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONUNBUFFERED=1
ENV PORT=8001
ENV PATH="/opt/venv/bin:$PATH"
ENV NODE_ENV=production
# Copy Python dependencies
COPY --from=py_deps /api/.venv /opt/venv
COPY api/ ./api/
# Expose port
EXPOSE 8001
CMD python -m api.main --host 0.0.0.0 --port ${PORT}