1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 01:22:51 +02:00

Use an alpine image rather than Debian buster: this is smaller

This commit is contained in:
Yohann D'ANELLO
2020-06-03 20:42:12 +02:00
parent a1d02ce657
commit dd62a32e08
6 changed files with 950 additions and 19 deletions

View File

@ -1,26 +1,29 @@
FROM python:3-buster
FROM python:3-alpine
ENV PYTHONUNBUFFERED 1
# Install LaTeX requirements
RUN apk add --no-cache gettext texlive nginx gcc libc-dev libffi-dev postgresql-dev
RUN apk add --no-cache bash
RUN mkdir /code
WORKDIR /code
# Install LaTeX requirements
RUN apt update && \
apt install -y gettext texlive-latex-extra texlive-fonts-extra texlive-lang-french nginx && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt --no-cache-dir
COPY . /code/
# Configure nginx
RUN ln -s nginx_tfjm.conf /etc/nginx/sites-available/tfjm.conf
RUN rm /var/log/nginx/*.log
RUN ln -s /dev/stdout /var/log/nginx/access.log
RUN ln -s /dev/stderr /var/log/nginx/error.log
RUN rm /etc/nginx/sites-enabled/default
RUN ln -sf /code/nginx_tfjm.conf /etc/nginx/sites-enabled/tfjm.conf
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_tfjm.conf /etc/nginx/conf.d/tfjm.conf
RUN rm /etc/nginx/conf.d/default.conf
RUN pip install -r requirements.txt
# With a bashrc, the shell is better
RUN ln -s /code/.bashrc /root/.bashrc
ENTRYPOINT ["/code/entrypoint.sh"]
EXPOSE 80
CMD ["./manage.py", "shell_plus", "--ptpython"]