[feat] Changed Dockerfile to use alpine. Size reduced from more than 350MB to 92MB

This commit is contained in:
Sébastien Lucas 2018-06-07 08:38:06 +02:00 committed by djrobstep
parent 14940abc8f
commit 447068ec0c

View File

@ -1,14 +1,13 @@
FROM python:3.6
FROM alpine:3.7
WORKDIR /usr/src/app
RUN apk add --no-cache python3 ca-certificates postgresql-dev && \
apk add --no-cache --virtual=build-dependencies build-base python3-dev && \
pip3 install --upgrade --no-cache-dir pip && \
pip3 install --no-cache-dir psycopg2-binary migra && \
apk del build-dependencies && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
COPY \
requirements.txt \
setup.py \
README.md \
./
RUN pip install --no-cache-dir -r requirements.txt
ENTRYPOINT [ "/usr/bin/migra" ]
COPY . .
CMD ["--help"]
ENTRYPOINT [ "migra" ]