Small fixes to improve project stability
This commit is contained in:
parent
843b2b6e55
commit
4bb81de1e4
2 changed files with 6 additions and 30 deletions
|
|
@ -1,8 +1,9 @@
|
|||
# Pull base image
|
||||
FROM python:3.12.2-bookworm
|
||||
|
||||
# Set environment variables
|
||||
# Set environment variables (we want to write bytecode as we have multiple workers)
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV PYTHONDONTWRITEBYTECODE 0
|
||||
|
||||
# Create and set work directory called `app`
|
||||
RUN mkdir -p /code
|
||||
|
|
@ -21,7 +22,7 @@ COPY . /code/
|
|||
COPY .env.production /code/.env
|
||||
ENV HOME=/code
|
||||
|
||||
RUN apt-get update && apt-get install -y nodejs npm xvfb netcat-openbsd
|
||||
RUN apt-get update && apt-get install -y nodejs npm xvfb netcat-openbsd nano curl
|
||||
|
||||
# Install playwright (via pip and install script)
|
||||
RUN playwright install-deps && playwright install
|
||||
|
|
@ -29,5 +30,7 @@ RUN playwright install-deps && playwright install
|
|||
# Expose port 8000
|
||||
EXPOSE 8000
|
||||
|
||||
HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
|
||||
|
||||
# Use gunicorn on port 8000
|
||||
CMD ["gunicorn", "--bind", ":8000", "django_project.wsgi", "--timeout", "300"]
|
||||
CMD ["gunicorn", "--bind", ":8000", "django_project.wsgi", "--workers", "4", "--worker-tmp-dir", "/dev/shm", "--timeout", "90"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue