FROM python:3-alpine ENV PYTHONUNBUFFERED 1 ENV DJANGO_ALLOW_ASYNC_UNSAFE 1 # Install LaTeX requirements RUN apk add --no-cache gcc gettext libc-dev nginx postgresql-dev RUN mkdir /code WORKDIR /code COPY requirements.txt /code/requirements.txt RUN pip install -r requirements.txt --no-cache-dir COPY . /code/ RUN python manage.py collectstatic --noinput && \ python manage.py compilemessages # 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.conf /etc/nginx/conf.d/django.conf RUN rm /etc/nginx/conf.d/default.conf ENTRYPOINT ["/code/entrypoint.sh"] EXPOSE 80 CMD ["./manage.py", "shell"]