2020-09-01 10:09:02 +00:00
|
|
|
FROM debian:buster-backports
|
2020-02-03 10:50:42 +00:00
|
|
|
|
2020-09-01 09:23:56 +00:00
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
2020-02-03 10:50:42 +00:00
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
|
2020-09-01 10:09:02 +00:00
|
|
|
# Install Django, external apps, LaTeX and dependencies
|
|
|
|
# Outside Docker, you may also need git, acl, python3-venv, uwsgi, uwsgi-plugin-python3, nginx
|
2020-09-01 09:23:56 +00:00
|
|
|
RUN apt-get update && \
|
2020-09-01 10:09:02 +00:00
|
|
|
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 && \
|
2020-09-01 09:23:56 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2020-02-03 10:50:42 +00:00
|
|
|
|
2020-09-01 09:23:56 +00:00
|
|
|
# Instal PyPI requirements
|
2020-09-01 10:09:02 +00:00
|
|
|
COPY requirements.txt /code/
|
|
|
|
RUN pip3 install -r /code/requirements.txt --no-cache-dir
|
2020-03-21 08:22:38 +00:00
|
|
|
|
2020-09-01 09:23:56 +00:00
|
|
|
# Copy code
|
|
|
|
WORKDIR /code
|
2020-03-10 22:37:54 +00:00
|
|
|
COPY . /code/
|
|
|
|
|
2020-09-01 09:23:56 +00:00
|
|
|
#RUN pip install gunicorn ptpython --no-cache-dir
|
|
|
|
|
2020-06-21 18:27:42 +00:00
|
|
|
# Configure nginx
|
|
|
|
RUN mkdir /run/nginx
|
|
|
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
|
|
|
RUN ln -sf /code/nginx_note.conf_docker /etc/nginx/conf.d/nginx_note.conf
|
|
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
2020-02-03 10:50:42 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/code/entrypoint.sh"]
|
2020-06-21 18:27:42 +00:00
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
CMD ["./manage.py", "shell_plus", "--ptpython"]
|