Commit aaa645f5 authored by Bruno Martin's avatar Bruno Martin
Browse files

update python version to 3.7; uses root user in containers on production; update nginx version

parent e714cee2
Pipeline #7380 failed with stages
in 15 seconds
FROM python:3.6
FROM python:3.7
LABEL mantainer "Hacklab <>"
FROM python:3.6 as django
FROM python:3.7 as django
LABEL mantainer "Hacklab <>"
# Ensure that the the internal user and
# group used by django have a known uid and gid
RUN groupadd -r -g 999 django \
&& useradd -r -u 999 -g django django
# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements /requirements
......@@ -15,32 +11,24 @@ RUN pip install --no-cache-dir -r /requirements/production.txt \
COPY ./compose/production/django/ /
RUN sed -i 's/\r//' /
RUN chmod +x /
RUN chown django /
COPY ./compose/production/django/ /
RUN sed -i 's/\r//' /
RUN chmod +x /
RUN chown django /
COPY . /app
RUN mkdir /app/staticfiles
# env.example must be used during build to provide a valid environment
RUN export $(cat /app/env.example | grep -v ^# | xargs) && \
python /app/ collectstatic --noinput
RUN chown -R django /app
USER django
CMD ["/"]
FROM nginx:1.13 as nginx
FROM nginx:1.16 as nginx
COPY ./compose/production/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=django /app/staticfiles/static/ /usr/share/nginx/html/static/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment