-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (26 loc) · 887 Bytes
/
Dockerfile
File metadata and controls
40 lines (26 loc) · 887 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
36
37
38
39
40
# Multi-stage build for Harvest backup tool
FROM python:3.13-alpine AS builder
WORKDIR /app
# Install uv via pip
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir uv
# Copy dependency files first for better caching
COPY pyproject.toml uv.lock ./
# Copy source code
COPY src/ ./src/
# Install dependencies and package from lock file (no dev dependencies)
RUN --mount=type=cache,target=/root/.cache/uv uv sync --no-dev --frozen
# Final stage
FROM python:3.13-alpine
ENV PYTHONUNBUFFERED=1
# Copy the virtual environment from builder
COPY --from=builder /app/.venv /app/.venv
# Copy source code (package is installed in editable mode)
COPY --from=builder /app/src /app/src
WORKDIR /
ENV PATH="/app/.venv/bin:$PATH"
# Expose Harvest PAT environment variable
ENV HARVEST_PAT=
VOLUME ["/backup"]
# Run the application
ENTRYPOINT ["harvest-backup"]