Skip to content

Commit

Permalink
Modifica o Dockerfile
Browse files Browse the repository at this point in the history
O Dockerfile passa a ser construído à partir da distribuição Alpine e em
múltiplos estágios a fim de resultar em uma imagem de tamanho reduzido.
  • Loading branch information
Gustavo Fonseca committed Jul 8, 2018
1 parent 6e8a954 commit 03a3e2d
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
FROM python:3.5
FROM python:3.5.2-alpine AS build
COPY . /src
RUN pip install --upgrade pip \
&& pip install wheel
RUN cd /src \
&& python setup.py bdist_wheel -d /deps

MAINTAINER [email protected]

COPY . /app
FROM python:3.5.2-alpine
MAINTAINER [email protected]

COPY --from=build /deps/* /deps/
COPY production.ini-TEMPLATE /app/config.ini
COPY alembic.ini-TEMPLATE /app/alembic.ini
COPY requirements.txt .

RUN pip install --upgrade pip
RUN chmod -R 755 /app/*
RUN apk add --no-cache --virtual .build-deps \
make gcc libxml2-dev libxslt-dev git musl-dev postgresql-dev \
&& apk add libxml2 libxslt postgresql-libs \
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-index --find-links=file:///deps -U doi_request \
&& apk --purge del .build-deps \
&& rm requirements.txt \
&& rm -rf /deps

WORKDIR /app

RUN python setup.py install
ENV PYTHONUNBUFFERED 1

USER nobody

0 comments on commit 03a3e2d

Please sign in to comment.