From 09853ce990e80f47476f5dca7ec7eec92d149164 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 1 Sep 2020 12:09:02 +0200 Subject: [PATCH] Use debian deps in Dockerfile --- Dockerfile | 19 +++++++++++-------- requirements.txt | 7 +++++++ requirements/base.txt | 31 ------------------------------- requirements/cas.txt | 1 - requirements/production.txt | 1 - 5 files changed, 18 insertions(+), 41 deletions(-) create mode 100644 requirements.txt delete mode 100644 requirements/base.txt delete mode 100644 requirements/cas.txt delete mode 100644 requirements/production.txt diff --git a/Dockerfile b/Dockerfile index b26d5fe4..bcec728c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,22 @@ -FROM debian:buster +FROM debian:buster-backports # Force the stdout and stderr streams to be unbuffered ENV PYTHONUNBUFFERED 1 -# Install APT requirements +# Install Django, external apps, LaTeX and dependencies +# Outside Docker, you may also need git, acl, python3-venv, uwsgi, uwsgi-plugin-python3, nginx RUN apt-get update && \ - apt-get install -y nginx python3 python3-pip python3-dev \ - uwsgi uwsgi-plugin-python3 python3-venv git acl gettext \ - libjs-bootstrap4 fonts-font-awesome \ - texlive-latex-extra texlive-fonts-extra texlive-lang-french && \ + apt-get install -t buster-backports -y python3-django python3-django-crispy-forms \ + python3-django-extensions python3-django-filters python3-django-polymorphic \ + python3-djangorestframework python3-django-cas-server python3-psycopg2 python3-pil \ + python3-babel python3-lockfile python3-pip \ + texlive-latex-extra texlive-fonts-extra texlive-lang-french \ + gettext libjs-bootstrap4 fonts-font-awesome && \ rm -rf /var/lib/apt/lists/* # Instal PyPI requirements -COPY requirements /code/requirements -RUN pip install -r requirements/base.txt -r requirements/cas.txt -r requirements/production.txt --no-cache-dir +COPY requirements.txt /code/ +RUN pip3 install -r /code/requirements.txt --no-cache-dir # Copy code WORKDIR /code diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..ac2104e2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +django-htcpcp-tea==0.3.1 +django-mailer==2.0.1 +django-phonenumber-field==4.0.0 +django-tables2==2.1.0 +django-rest-polymorphic==0.1.8 +django-bootstrap-datepicker-plus==3.0.5 +django-colorfield==0.3.2 diff --git a/requirements/base.txt b/requirements/base.txt deleted file mode 100644 index ba380f73..00000000 --- a/requirements/base.txt +++ /dev/null @@ -1,31 +0,0 @@ -beautifulsoup4==4.9.1 -certifi==2019.6.16 -chardet==3.0.4 -defusedxml==0.6.0 -Django~=2.2 -django-allauth==0.39.1 -django-crispy-forms==1.7.2 -django-extensions==2.1.9 -django-filter==2.2.0 -django-htcpcp-tea==0.3.1 -django-mailer==2.0.1 -django-phonenumber-field==4.0.0 -django-polymorphic==2.0.3 -django-tables2==2.1.0 -docutils==0.14 -idna==2.8 -lxml==4.5.2 -oauthlib==3.1.0 -phonenumbers==8.12.7 -Pillow==7.1.2 -python3-openid==3.1.0 -pytz==2019.1 -requests==2.22.0 -requests-oauthlib==1.2.0 -six==1.12.0 -sqlparse==0.3.0 -djangorestframework==3.9.0 -django-rest-polymorphic==0.1.8 -urllib3==1.25.3 -django-bootstrap-datepicker-plus==3.0.5 -django-colorfield==0.3.2 diff --git a/requirements/cas.txt b/requirements/cas.txt deleted file mode 100644 index 8a0baa85..00000000 --- a/requirements/cas.txt +++ /dev/null @@ -1 +0,0 @@ -django-cas-server==1.2.0 diff --git a/requirements/production.txt b/requirements/production.txt deleted file mode 100644 index fe939cce..00000000 --- a/requirements/production.txt +++ /dev/null @@ -1 +0,0 @@ -psycopg2-binary==2.8.4