forked from flancian/agora-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (25 loc) · 755 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
33
34
35
36
37
38
39
40
FROM alpine:3.13.6 as base
RUN apk add python3 libxml2 libxslt
WORKDIR /app
# create agora user
RUN ["adduser", "-D", "agora"]
FROM base as dev
RUN apk add py3-pip npm yarn make g++ libxml2-dev libxslt-dev python3-dev musl-dev gcc linux-headers git
RUN yarn global add parcel
USER agora
ENV FLASK_ENV development
CMD ["tail", "-f", "/dev/null"]
FROM dev as builder
USER root
COPY . .
RUN ["make", "purge"]
RUN ["make", "build"]
FROM base as prod
RUN apk add nginx
COPY --from=builder /app/app ./app
COPY --from=builder /app/venv ./venv
COPY --from=builder /app/conf/prod.ini .
COPY --from=builder /app/conf/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/scripts/run-prod.sh .
ENV FLASK_ENV production
ENTRYPOINT ["./run-prod.sh"]