File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM python:3.11
1+ FROM docker.io/python:3.11-slim AS base
2+ ENV LANG=C.UTF-8
3+ ENV LC_ALL=C.UTF-8
4+ ENV PYTHONDONTWRITEBYTECODE=1
5+ ENV PYTHONFAULTHANDLER=1
26
3- RUN useradd -u 65532 -d /app -m appuser
4- USER 65532
5-
6- WORKDIR /app
7+ FROM base AS builder
8+ RUN pip install pipenv
9+ COPY Pipfile* ./
10+ RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
711
8- COPY Pipfile* *.py LICENSE /app/
9-
10- RUN pip install --no-cache-dir pipenv
11- RUN /app/.local/bin/pipenv install --system --deploy
12- # Maybe "pipenv sync" would be better. I'm unsure:
13- # https://pipenv-fork.readthedocs.io/en/latest/advanced.html#using-pipenv-for-deployments
12+ FROM base
13+ RUN adduser --uid 65532 nonroot
14+ COPY --from=builder /.venv /.venv
15+ ENV PATH="/.venv/bin:$PATH"
16+ COPY *.py LICENSE ./
1417
1518EXPOSE 8080 9090
19+ USER 65532
1620ENV prometheus_multiproc_dir=/tmp
17- CMD ["/app/.local/bin/gunicorn" , "-c" , "gunicorn_conf.py" , "server:app" ]
21+ ENTRYPOINT ["/app/.local/bin/gunicorn" , "-c" , "gunicorn_conf.py" , "server:app" ]
You can’t perform that action at this time.
0 commit comments