mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Rework on Docker image
This commit is contained in:
32
Dockerfile
32
Dockerfile
@ -1,25 +1,27 @@
|
||||
FROM python:3-buster
|
||||
FROM python:3-alpine
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# Install LaTeX requirements
|
||||
RUN apk add --no-cache gettext texlive texmf-dist-latexextra texmf-dist-fontsextra nginx gcc libc-dev libffi-dev postgresql-dev libxml2-dev libxslt-dev jpeg-dev
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
RUN mkdir /code
|
||||
WORKDIR /code
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y gettext nginx uwsgi uwsgi-plugin-python3 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install LaTeX requirements
|
||||
RUN apt update && \
|
||||
apt install -y texlive-latex-extra texlive-fonts-extra texlive-lang-french && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
COPY requirements /code/requirements
|
||||
RUN pip install gunicorn ptpython --no-cache-dir
|
||||
RUN pip install -r requirements/base.txt -r requirements/cas.txt -r requirements/production.txt --no-cache-dir
|
||||
|
||||
COPY . /code/
|
||||
|
||||
# Comment what is not needed
|
||||
RUN pip install -r requirements/base.txt
|
||||
RUN pip install -r requirements/cas.txt
|
||||
RUN pip install -r requirements/production.txt
|
||||
# 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
|
||||
|
||||
ENTRYPOINT ["/code/entrypoint.sh"]
|
||||
EXPOSE 8000
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["./manage.py", "shell_plus", "--ptpython"]
|
||||
|
Reference in New Issue
Block a user