add gunicorn + update modules

This commit is contained in:
Grégory Lebreton 2025-02-05 16:18:14 +01:00
parent 5ec8a25be7
commit 1a0eb07031
17 changed files with 48 additions and 10 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
db.sqlite3
quiz-app/db.sqlite3
Pipfile
Pipfile.lock
essay/__pycache__
@ -9,4 +9,4 @@ true_false/__pycache__
true_false/__init__.py
multichoice/__pycache__
multichoice/__init__.py
venv
quiz-venv

View File

@ -14,3 +14,26 @@ COPY quiz-app/requirements.txt /code/
RUN pip install -r requirements.txt
COPY quiz-app/. /code/
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
# BUILD
FROM python:3.11-slim-bookworm AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
COPY quiz-app/requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# FINAL
FROM python:3.11-slim-bookworm
WORKDIR /code
COPY --from=builder /install /usr/local
COPY quiz-app/. .
EXPOSE 8000
CMD ["gunicorn", "-b", "0.0.0.0:8000", "app.wsgi:application"]

View File

@ -1,8 +1,23 @@
django>=2.2.9
django-admin
django-model-utils>=3.1.1
Pillow>=4.0.0
psycopg2-binary
six
environs
asgiref==3.8.1
Django==5.1.6
django-admin==2.0.2
django-excel-response2==3.0.6
django-model-utils==5.0.0
django-six==1.0.5
environs==14.1.0
excel-base==1.0.4
gunicorn==23.0.0
isoweek==1.3.3
marshmallow==3.26.1
packaging==24.2
pillow==11.1.0
psycopg2-binary==2.9.10
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
screen==1.0.1
six==1.17.0
sqlparse==0.5.3
TimeConvert==3.0.13
tzlocal==5.2
whitenoise==6.6.0
xlwt==1.3.0

0
requirements.txt Normal file
View File