-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 817 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 817 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-bookworm AS base
# Fail fast if any command errors
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############################ System dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
############################ Set work directory
WORKDIR /app
############################ Copy Python deps separately for better caching
COPY requirements.txt .
# Upgrade pip first, then install deps
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
############################ Copy application code
COPY . .
############################ Expose API port
EXPOSE 8000
############################ Start the FastAPI server
CMD ["python", "-m", "src.main"]