30 lines
934 B
Docker
30 lines
934 B
Docker
FROM python:3.12.2-bookworm
|
|
|
|
# (we want to write bytecode as we have multiple workers, so omit PYTHONDONTWRITEBYTECODE)
|
|
ENV PYTHONUNBUFFERED 1
|
|
ENV HOME /code
|
|
|
|
RUN mkdir -p /code
|
|
WORKDIR /code
|
|
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
|
|
RUN set -ex && \
|
|
pip install --upgrade pip && \
|
|
pip install -r /tmp/requirements.txt && \
|
|
rm -rf /root/.cache/
|
|
|
|
RUN apt-get update && apt-get install -y nodejs npm xvfb netcat-openbsd nano curl
|
|
|
|
RUN playwright install-deps && playwright install
|
|
|
|
COPY . /code/
|
|
RUN rm -f .env
|
|
COPY .env.production .env
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
|
|
|
|
#CMD ["gunicorn", "--bind", ":8000", "django_project.wsgi", "--workers", "3", "--worker-class", "gevent", "--worker-connections", "1000", "--worker-tmp-dir", "/dev/shm", "--timeout", "90"]
|
|
CMD ["granian", "--interface", "wsgi", "django_project.wsgi", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|