-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 804 Bytes
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 804 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
# ---------- Builder ----------
FROM python:3.13-slim AS builder
# Install git only for dependency build
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml README.md ./
COPY . .
# Upgrade pip and install dependencies into custom prefix
RUN pip install --upgrade pip \
&& pip install --no-cache-dir --prefix=/install .
# ---------- Runtime ----------
FROM python:3.13-slim
WORKDIR /app
# Copy installed packages
COPY --from=builder /install /usr/local
# Copy app code
COPY . .
ENV PYTHONUNBUFFERED=1
EXPOSE 8000
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Run entrypoint.sh for db migrations, ..
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"]