Browse Source

Removed dev packages from final image (#3258)

* Migra imagem do SAPL de Alpine para Debian (slim-buster)

* Otimiza criação de imagem

* Mais refactorings

* Removed dev packages from final image

Co-authored-by: eribeiro <edwardr@senado.leg.br>
Co-authored-by: Edward <9326037+edwardoliveira@users.noreply.github.com>
pull/3261/head
Fábio Kaiser Rauber 4 years ago
committed by GitHub
parent
commit
4d65daeaf2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      Dockerfile

27
Dockerfile

@ -9,11 +9,13 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV BUILD_PACKAGES apt-file libpq-dev graphviz-dev graphviz build-essential git pkg-config \ ENV BUILD_PACKAGES apt-utils apt-file libpq-dev graphviz-dev build-essential git pkg-config \
python3-dev libxml2-dev libjpeg-dev libssl-dev libffi-dev libxslt1-dev \ python3-dev libxml2-dev libjpeg-dev libssl-dev libffi-dev libxslt1-dev \
python3-lxml python3-magic postgresql-client libcairo2-dev \ libcairo2-dev software-properties-common python3-setuptools python3-pip
python3-psycopg2 poppler-utils vim curl jq vim bash software-properties-common \
software-properties-common python3-setuptools python3-venv nginx tzdata nodejs ENV RUN_PACKAGES graphviz python3-lxml python3-magic postgresql-client python3-psycopg2 \
poppler-utils curl jq bash python3-venv tzdata nodejs \
fontconfig ttf-dejavu python nginx
RUN mkdir -p /var/interlegis/sapl RUN mkdir -p /var/interlegis/sapl
@ -21,16 +23,15 @@ WORKDIR /var/interlegis/sapl/
ADD . /var/interlegis/sapl/ ADD . /var/interlegis/sapl/
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils && \ RUN apt-get update && \
mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7 && \ apt-get upgrade -y && \
apt-get install -y fontconfig ttf-dejavu && fc-cache -fv && \ apt-get install -y --no-install-recommends $BUILD_PACKAGES $RUN_PACKAGES && \
apt-get install -y --no-install-recommends $BUILD_PACKAGES && \ fc-cache -fv && \
apt-get install -y python python3-pip && \ pip3 install --no-cache-dir --upgrade pip setuptools && \
pip3 install --upgrade pip setuptools && \
rm -f /etc/nginx/conf.d/* && \ rm -f /etc/nginx/conf.d/* && \
pip install -r /var/interlegis/sapl/requirements/dev-requirements.txt --upgrade setuptools && \ pip install --no-cache-dir -r /var/interlegis/sapl/requirements/dev-requirements.txt --upgrade setuptools && \
rm -r /root/.cache && \ SUDO_FORCE_REMOVE=yes apt-get purge -y --auto-remove $BUILD_PACKAGES && \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
COPY start.sh /var/interlegis/sapl/ COPY start.sh /var/interlegis/sapl/
COPY config/nginx/sapl.conf /etc/nginx/conf.d COPY config/nginx/sapl.conf /etc/nginx/conf.d

Loading…
Cancel
Save