-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.wolfi
More file actions
29 lines (27 loc) · 1.02 KB
/
Dockerfile.wolfi
File metadata and controls
29 lines (27 loc) · 1.02 KB
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
# syntax=docker/dockerfile:1
FROM chainguard/wolfi-base:latest@sha256:52e71f61c6afd1f8d2625cff4465d8ecee156668ca665f7e9c582d1cc914eb6a AS wolfi-debug
ARG NONROOT=nonroot
ARG VIRTUAL_ENV=/opt/venv
ARG WORKDIR=/app
ENV NONROOT=${NONROOT} \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
VIRTUAL_ENV=${VIRTUAL_ENV} \
WORKDIR=${WORKDIR} \
PATH="${VIRTUAL_ENV}/bin:${PATH}"
WORKDIR $WORKDIR
COPY --chown=$NONROOT ./requirements/base.txt requirements/base.txt
COPY --chown=$NONROOT ./requirements/common.txt requirements/common.txt
RUN apk update \
&& apk add --no-cache python-3.13 \
&& chown $NONROOT:$NONROOT $WORKDIR \
&& python3 -m venv $VIRTUAL_ENV \
&& chown -R $NONROOT:$NONROOT $VIRTUAL_ENV \
&& python3 -m pip install --no-cache-dir -r requirements/base.txt \
&& python3 -m uv pip install --no-cache --no-deps -r requirements/common.txt
USER $NONROOT
COPY --chown=$NONROOT app app
ENTRYPOINT [ "" ]
CMD [ "python3", "-m", "fastapi", "run", "app/main.py", "--port", "1337" ]