mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-21 07:58:22 +02:00
Restart the project in Django
This commit is contained in:
52
Dockerfile
52
Dockerfile
@ -1,39 +1,31 @@
|
||||
FROM php:7.3-apache as plateforme-builder
|
||||
FROM python:3-alpine
|
||||
|
||||
# Enabling apache rewrite mod
|
||||
RUN a2enmod rewrite
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN apt clean && apt update && apt upgrade -y
|
||||
# Install LaTeX requirements
|
||||
RUN apk add --no-cache gettext texlive nginx gcc libc-dev libffi-dev postgresql-dev mariadb-connector-c-dev
|
||||
|
||||
# Install MySQL drivers
|
||||
RUN docker-php-ext-install pdo_mysql \
|
||||
&& docker-php-ext-enable pdo_mysql
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
# Install zip utilities
|
||||
RUN apt install -y libzip-dev zip \
|
||||
&& docker-php-ext-configure zip --with-libzip \
|
||||
&& docker-php-ext-install zip \
|
||||
&& docker-php-ext-enable zip
|
||||
RUN mkdir /code
|
||||
WORKDIR /code
|
||||
COPY requirements.txt /code/requirements.txt
|
||||
RUN pip install -r requirements.txt --no-cache-dir
|
||||
|
||||
# Setup locales
|
||||
RUN apt install locales locales-all -y && locale-gen fr_FR.UTF-8
|
||||
ENV LANG fr_FR.UTF-8
|
||||
ENV LANGUAGE fr_FR:fr
|
||||
ENV LC_ALL fr_FR.UTF-8
|
||||
COPY . /code/
|
||||
|
||||
# Setup timezone
|
||||
RUN echo Europe/Paris > /etc/timezone \
|
||||
&& ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime \
|
||||
&& dpkg-reconfigure -f noninteractive tzdata
|
||||
# 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_corres2math.conf /etc/nginx/conf.d/corres2math.conf
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Setup mailing
|
||||
RUN apt install -yq msmtp ca-certificates
|
||||
COPY setup/msmtprc /etc/msmtprc
|
||||
RUN echo "sendmail_path=msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
|
||||
RUN cp /code/corres2math.cron /etc/crontabs/corres2math
|
||||
|
||||
# Setting environment
|
||||
ENV CORRES2MATH_LOCAL_PATH /var/www/html
|
||||
ENV CORRES2MATH_MAIL_DOMAIN correspondances-maths.fr
|
||||
ENV CORRES2MATH_URL_BASE https://inscription.correspondances-maths.fr
|
||||
# With a bashrc, the shell is better
|
||||
RUN ln -s /code/.bashrc /root/.bashrc
|
||||
|
||||
RUN chmod 0777 /var/www/html
|
||||
ENTRYPOINT ["/code/entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["./manage.py", "shell_plus", "--ptpython"]
|
||||
|
Reference in New Issue
Block a user