-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
49 lines (40 loc) · 1.43 KB
/
Dockerfile
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
48
49
FROM python:3.8.5-alpine3.11
# Build Args
ARG BUILD_DATE=None
ARG VCS_REF=None
ARG BUILD_VERSION=None
# Labels.
LABEL maintainer="[email protected]" \
org.label-schema.schema-version="1.0" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="1904labs/geohack-collab-project" \
org.label-schema.description="1904labs Geosaptial Hackathon Collaborative Project" \
org.label-schema.url="https://1904labs.com/" \
org.label-schema.vcs-url="https://github.com/1904labs/geohack-collab-project" \
org.label-schema.vcs-ref=${VCS_REF} \
org.label-schema.vendor="1904labs" \
org.label-schema.version=${BUILD_VERSION} \
org.label-schema.docker.cmd="docker run -p 8080:80 -d 1904labs/geohack-collab-project:latest"
RUN set -ex && \
apk add --update --no-cache bash nodejs npm && \
pip3 install --upgrade pip && \
pip3 install pipenv
WORKDIR /opt/project
COPY Pipfile* config-overrides.js *.json ./
ENV NODE_OPTIONS=--max-old-space-size=8192
# install environments
RUN apk add --no-cache --virtual .build-deps \
gcc libffi-dev musl-dev postgresql-dev && \
pipenv install --deploy --system && \
apk del --no-network .build-deps
RUN npm ci
# avoid npm builds unless needed
COPY app/src app/src
COPY app/public app/public
RUN npm run build
COPY ./ ./
CMD [ "gunicorn", \
"app:create_app('production')", \
"--workers", "15", \
"--bind", "0.0.0.0:8000" \
]