-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|