-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (34 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
47 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.6-alpine3.7 AS builder
# update pip
RUN pip install --upgrade pip
# install pipenv
RUN pip install pipenv
RUN mkdir /app
WORKDIR /app
# prerequisite for psycopg2
RUN apk add --no-cache build-base postgresql-dev
COPY Pipfile Pipfile.lock /app/
RUN pipenv install --deploy --ignore-pipfile --system
# clean up to reduce the size of the build image
RUN pip uninstall -y pipenv virtualenv virtualenv-clone
#########################################
FROM python:3.6-alpine3.7 AS runner
WORKDIR /app
ENV FLASK_ENV=production
CMD ["./entrypoint.sh"]
# For installing docker
RUN echo http://dl-cdn.alpinelinux.org/alpine/v3.7/community >> /etc/apk/repositories
RUN apk update
RUN apk add --no-cache docker uwsgi-python3 curl libpq
# executables
COPY --from=builder /usr/local/bin/celery /usr/local/bin/
COPY --from=builder /usr/local/bin/flower /usr/local/bin/
COPY --from=builder /usr/local/bin/flask /usr/local/bin/
# site packages
COPY --from=builder /usr/local/lib/python3.6/site-packages/ /usr/local/lib/python3.6/site-packages/
# source files
COPY docker/* ./
COPY data ./data
COPY migrations ./migrations
COPY run.py ./
COPY app ./app