-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (18 loc) · 789 Bytes
/
Dockerfile
File metadata and controls
29 lines (18 loc) · 789 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
FROM python:3.13-slim-bookworm AS requirements-stage
WORKDIR /tmp
RUN pip install --no-cache-dir uv==0.7.12
COPY ./pyproject.toml ./uv.lock /tmp/
# Delete `-e .` line from requirements.txt
RUN uv export --format requirements-txt --no-dev --no-hashes --output-file requirements.txt && \
sed -i '/^-e .*/d' requirements.txt
FROM python:3.13-slim-bookworm
ARG GIT_REVISION="0000000"
ARG GIT_TAG="x.x.x"
WORKDIR /app
# Copy requirements first for better cache efficiency
COPY --from=requirements-stage /tmp/requirements.txt /app/requirements.txt
# Install dependencies in a separate layer for caching
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
# Copy application code after dependencies are installed
COPY . .
CMD ["python", "-m", "template_python.core"]