2024-01-13 16:09:45 +00:00
|
|
|
FROM python:3.12-alpine
|
2020-12-27 10:49:54 +00:00
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
ENV DJANGO_ALLOW_ASYNC_UNSAFE 1
|
|
|
|
|
2024-06-07 21:46:51 +00:00
|
|
|
RUN apk add --no-cache gettext nginx gcc git libc-dev libffi-dev libxml2-dev libxslt-dev npm postgresql-dev libmagic texlive texmf-dist-fontsrecommended texmf-dist-lang texmf-dist-latexextra
|
2020-12-27 10:49:54 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache bash
|
|
|
|
|
2024-06-02 17:47:35 +00:00
|
|
|
RUN npm install -g yuglify
|
|
|
|
|
2021-01-20 14:00:26 +00:00
|
|
|
RUN mkdir /code /code/docs
|
2020-12-27 10:49:54 +00:00
|
|
|
WORKDIR /code
|
|
|
|
COPY requirements.txt /code/requirements.txt
|
2021-01-20 14:00:26 +00:00
|
|
|
COPY docs/requirements.txt /code/docs/requirements.txt
|
2020-12-27 10:49:54 +00:00
|
|
|
RUN pip install -r requirements.txt --no-cache-dir
|
2021-01-20 14:00:26 +00:00
|
|
|
RUN pip install -r docs/requirements.txt --no-cache-dir
|
2020-12-27 10:49:54 +00:00
|
|
|
|
|
|
|
COPY . /code/
|
|
|
|
|
2021-01-20 14:00:26 +00:00
|
|
|
# Compile documentation
|
|
|
|
RUN sphinx-build -M html docs docs/_build
|
|
|
|
|
2020-12-27 10:49:54 +00:00
|
|
|
RUN python manage.py collectstatic --noinput && \
|
|
|
|
python manage.py compilemessages
|
|
|
|
|
|
|
|
# Configure nginx
|
|
|
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
2022-01-11 23:48:53 +00:00
|
|
|
RUN ln -sf /code/nginx_tfjm.conf /etc/nginx/http.d/tfjm.conf && rm /etc/nginx/http.d/default.conf
|
2020-12-27 10:49:54 +00:00
|
|
|
|
|
|
|
RUN crontab /code/tfjm.cron
|
|
|
|
|
|
|
|
# With a bashrc, the shell is better
|
|
|
|
RUN ln -s /code/.bashrc /root/.bashrc
|
|
|
|
|
|
|
|
ENTRYPOINT ["/code/entrypoint.sh"]
|
|
|
|
EXPOSE 80
|
|
|
|
|
2021-01-18 16:29:48 +00:00
|
|
|
CMD ["./manage.py", "shell_plus", "--ipython"]
|