2024-02-29 20:25:59 +00:00
|
|
|
FROM python:3.12-slim-bullseye
|
2021-02-09 21:04:02 +00:00
|
|
|
|
|
|
|
ENV PYTHONFAULTHANDLER=1 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
PYTHONHASHSEED=random \
|
|
|
|
PIP_NO_CACHE_DIR=off \
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
2022-11-21 19:51:09 +00:00
|
|
|
PIP_DEFAULT_TIMEOUT=100
|
|
|
|
ARG BUILD
|
|
|
|
ENV BUILD ${BUILD}
|
2021-02-09 21:04:02 +00:00
|
|
|
|
2024-03-03 10:05:08 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-07-14 19:19:32 +00:00
|
|
|
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www \
|
2024-03-03 10:05:08 +00:00
|
|
|
&& apt-get update \
|
2021-02-09 21:04:02 +00:00
|
|
|
&& apt-get install -y \
|
|
|
|
binutils \
|
|
|
|
libpq-dev \
|
|
|
|
build-essential \
|
|
|
|
netcat-openbsd \
|
|
|
|
libcairo2 \
|
|
|
|
libpango-1.0-0 \
|
|
|
|
libpangocairo-1.0-0 \
|
|
|
|
libgdk-pixbuf2.0-0 \
|
|
|
|
libffi-dev \
|
|
|
|
shared-mime-info \
|
2024-07-14 19:19:32 +00:00
|
|
|
gettext
|
|
|
|
|
|
|
|
COPY --chown=www:www . .
|
|
|
|
|
|
|
|
RUN mkdir /app/src/static \
|
|
|
|
&& chown www:www /app/src/static
|
|
|
|
|
|
|
|
RUN pip install . \
|
2024-03-03 10:05:08 +00:00
|
|
|
&& django-admin compilemessages
|
2021-02-09 21:04:02 +00:00
|
|
|
|
2021-02-09 21:48:53 +00:00
|
|
|
ENTRYPOINT ["./entrypoint.sh"]
|
2021-03-01 16:49:37 +00:00
|
|
|
|
2021-03-01 20:44:57 +00:00
|
|
|
EXPOSE 8000
|
|
|
|
|
2021-03-01 16:49:37 +00:00
|
|
|
CMD ["uvicorn", "project.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--workers", "3", "--lifespan", "off", "--app-dir", "/app/src"]
|