forked from nasa/apod-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 889 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 889 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.12-slim
# Install uv directly from its official image
COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /bin/uv
# Set the working directory inside the container
WORKDIR /app
# Copy dependency files first.
# This allows Docker to cache the installed packages layer.
# If you change your code but not your dependencies, this step will be skipped.
COPY pyproject.toml uv.lock ./
# Install dependencies into the system python environment.
RUN uv sync --frozen --no-dev
# This makes 'gunicorn' and 'flask' available globally in the container
ENV PATH="/app/.venv/bin:$PATH"
# Copy the rest of the application code
COPY . .
# Expose the port the app runs on
EXPOSE 5000
# Run the production server
# -w 4: Run 4 worker processes
# -b 0.0.0.0:5000: Listen on all interfaces on port 5000
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--access-logfile", "-", "application:app"]