-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile-debian
More file actions
33 lines (27 loc) · 901 Bytes
/
Dockerfile-debian
File metadata and controls
33 lines (27 loc) · 901 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
# FROM debian:trixie-20250811-slim as install
FROM python:3.13.7-slim-trixie as install
RUN apt-get update && apt-get install -y --no-install-recommends pipx git && rm -rf /var/lib/apt/lists/*
RUN pipx install uv
ENV PATH="/root/.local/bin:${PATH}"
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
COPY pyproject.toml uv.lock feedmixer_api.py feedmixer_wsgi.py feedmixer.py /app/
COPY test /app/test
WORKDIR /app/
RUN uv venv && \
uv sync && \
uv pip install gunicorn && \
.venv/bin/python -m unittest discover test/unit && \
rm -rf test/ && \
find /app/.venv -type d -name __pycache__ -exec rm -rf {} +
# build layer without git, pipx, or uv
FROM python:3.13.7-slim-trixie
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
copy --from=install /app/ /app
RUN chown -R nobody /app/
WORKDIR /app/
ENV PATH="/app/.venv/bin/:$PATH"
USER nobody
ENTRYPOINT ["gunicorn"]
CMD ["-b", ":8000", "feedmixer_wsgi"]