-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 793 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 793 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
FROM python:3.8-slim-buster
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV POETRY_VIRTUALENVS_CREATE=0
ENV USER=app_user
RUN adduser --uid 1000 --gecos --quiet --disabled-password $USER
RUN mkdir -p /usr/src/app \
&& chown $USER.$USER /usr/src/app
WORKDIR /usr/src/app
COPY --chown=$USER pyproject.toml poetry.lock ./
ARG POETRY_ARGS=
RUN set -eux \
&& apt update \
&& apt upgrade -y \
&& apt install -y curl\
&& pip3 install poetry \
&& poetry install --no-root --no-interaction $POETRY_ARGS \
&& apt autoremove -y \
&& rm -rf /root/.cache/pip /root/.cache/pypoetry /var/cache/apt
COPY --chown=$USER . .
USER $USER
CMD ["/usr/local/bin/gunicorn", "base_app.asgi:application", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000"]