-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1003 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1003 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
# Stage 1: Build dependencies
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
WORKDIR /app
# Copy only requirements to leverage caching
COPY requirements.txt .
RUN uv pip install --system --no-cache-dir -r requirements.txt gunicorn
# Stage 2: Runtime image
FROM python:3.13-alpine
WORKDIR /app
# Copy only the Python runtime and installed dependencies from builder
COPY --from=builder /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/
COPY --from=builder /usr/local/bin/gunicorn /usr/local/bin/gunicorn
# Copy application files
COPY app.py .
COPY lib ./lib
COPY static ./static
COPY templates ./templates
# Ensure lib is a Python package
RUN touch lib/__init__.py
# Set environment variables
ENV PYTHONPATH=/app:/app/lib \
PORT=5000
# Optional environment variables:
# APTREPO: Set a default repository URL (e.g., APTREPO=https://apt.armbian.com)
# Expose the port
EXPOSE 5000
# Run the app
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]