From f13dafc281ac454515c4a2a9dd994192aa99c89f Mon Sep 17 00:00:00 2001 From: eribeiro Date: Tue, 1 Sep 2020 15:04:09 -0300 Subject: [PATCH] =?UTF-8?q?Otimiza=20cria=C3=A7=C3=A3o=20de=20imagem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 78287ad42..5f54aec2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-slim-buster as base +FROM python:3.7-slim-buster # Setup env ENV LANG C.UTF-8 @@ -11,23 +11,18 @@ ENV DEBIAN_FRONTEND noninteractive ENV BUILD_PACKAGES apt-file libpq-dev graphviz-dev graphviz build-essential git pkg-config \ python3-dev libxml2-dev libjpeg-dev libssl-dev libffi-dev libxslt1-dev pgadmin3 \ - python3-lxml python3-magic postgresql-contrib postgresql-client libcairo2-dev \ - python3-psycopg2 poppler-utils vim curl jq vim openssh-client bash software-properties-common \ + python3-lxml python3-magic postgresql-client libcairo2-dev \ + python3-psycopg2 poppler-utils vim curl jq vim bash software-properties-common \ software-properties-common python3-setuptools python3-venv nginx tzdata nodejs -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils - -RUN apt-get install -y --no-install-recommends $BUILD_PACKAGES - -RUN mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7 -RUN apt-get install -y fontconfig ttf-dejavu && fc-cache -fv - - -FROM base as python-base - -RUN apt-get install -y python python3-pip && \ +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils && \ + mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7 && \ + apt-get install -y fontconfig ttf-dejavu && fc-cache -fv && \ + apt-get install -y --no-install-recommends $BUILD_PACKAGES && \ + apt-get install -y python python3-pip && \ pip3 install --upgrade pip setuptools && \ - rm -f /etc/nginx/conf.d/* + rm -f /etc/nginx/conf.d/* && \ + apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/interlegis/sapl @@ -46,8 +41,6 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env RUN python3 manage.py collectstatic --noinput --clear -FROM python-base - # Remove .env(fake) e sapl.db da imagem RUN rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db