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 <contato@hacklab.com.br>"
ENV PYTHONUNBUFFERED 1
......
FROM python:3.6 as django
FROM python:3.7 as django
LABEL mantainer "Hacklab <contato@hacklab.com.br>"
ENV PYTHONUNBUFFERED 1
# 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/gunicorn.sh /gunicorn.sh
RUN sed -i 's/\r//' /gunicorn.sh
RUN chmod +x /gunicorn.sh
RUN chown django /gunicorn.sh
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r//' /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown django /entrypoint.sh
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/manage.py collectstatic --noinput
RUN chown -R django /app
USER django
WORKDIR /app
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/gunicorn.sh"]
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