-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (24 loc) · 820 Bytes
/
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
# frontend: node + js
FROM node:12.12.0-alpine as vue-build-stage
WORKDIR /app
COPY ./frontend/frontend/package.json ./
RUN npm install
COPY ./frontend/frontend .
RUN npm run build
# backend: django and nginx
FROM nginx:1.17.4-alpine as prod-stage
WORKDIR /app
RUN apk update \
&& apk add --no-cache python3 \
&& pip3 install --upgrade pip setuptools
#RUN apk update \
# && apk add postgresql-dev gcc python3-dev
COPY --from=vue-build-stage /app/dist /usr/share/nginx/html
COPY ./nginx_default.conf /etc/nginx/conf.d/default.conf
COPY ./backend/requirements.txt ./
RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn
COPY ./backend .
CMD gunicorn --workers 4 --bind 0.0.0.0:5000 --daemon server:app \
&& sed -i -e "s/__PORT__/$PORT/" /etc/nginx/conf.d/default.conf \
&& nginx -g 'daemon off;'