Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit c7b78ef

Browse files
committed
Use multi-stage build for Docker
1 parent 52fc748 commit c7b78ef

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Dockerfile

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
FROM python:alpine
1+
FROM python:3.6-alpine3.7 as common
22
3+
# Install any binary package dependencies here
4+
RUN apk --no-cache add \
5+
yaml
6+
7+
FROM common as build
8+
# Install build tools, and build wheels of all dependencies
9+
RUN apk --no-cache add \
10+
build-base \
11+
git \
12+
yaml-dev
313
COPY . /ais
414
WORKDIR /ais
5-
RUN pip install .
15+
RUN pip wheel . --wheel-dir=/wheels/
16+
17+
FROM common as production
18+
# Get rid of all build dependencies, install application using only pre-built binary wheels
19+
COPY --from=build /wheels/ /wheels/
20+
RUN pip install --no-index --find-links=/wheels/ --only-binary all /wheels/fiaas_ais*.whl
21+
EXPOSE 5000
622
CMD ["ais"]

0 commit comments

Comments
 (0)