forked from jptrsn/zip-captions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (52 loc) · 1.65 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ARG IMAGE=node:lts-alpine
FROM $IMAGE as base_image
WORKDIR /usr/src/app
COPY package*.json .
ARG NX_NON_NATIVE_HASHER=true
RUN npm ci --ignore-scripts
# DEVELOPMENT
FROM base_image as dev
COPY . .
CMD [""]
# STAGING
FROM dev as staging_build_client
ENV ZIP_SOCKET_SERVER=wss://api.zipcaptions.app
ENV ZIP_PEER_SERVER=https://api.zipcaptions.app
ENV ZIP_PEER_PORT=3000
ENV ZIP_AUTH_API_URL=https://api.zipcaptions.app
ENV ZIP_AUTH_API_VERSION=v1
RUN npm run build:client:staging
FROM dev as staging_build_signal
RUN npm run build:signal
FROM dev as staging_build_server
RUN npm run build:server
FROM nginx:alpine as staging_client
COPY --from=staging_build_client /usr/src/app/docs /usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 443
FROM staging_build_signal as staging_signal
CMD ["node", "./dist/packages/signal/main.js"]
EXPOSE 3000 9000
FROM staging_build_server as staging_server
CMD ["node", "./dist/packages/server/main.js"]
EXPOSE 3000 9000
FROM dev as prod_build_client
ENV ZIP_SOCKET_SERVER=https://socket.zipcaptions.app
ENV ZIP_SOCKET_PORT=443
ENV ZIP_PEER_SERVER=peer.zipcaptions.app
ENV ZIP_PEER_PORT=443
RUN npm run build:client
FROM nginx:alpine as prod_client
COPY --from=staging_build_client /usr/src/app/docs /usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
FROM dev as prod_build_signal
RUN npm run build:signal
FROM staging_build_signal as prod_signal
CMD ["node", "./dist/packages/signal/main.js"]
EXPOSE 3000 9000
FROM dev as prod_build_server
RUN npm run build:server
FROM prod_build_server as prod_server
CMD ["node", "./dist/packages/server/main.js"]
EXPOSE 3000 9000