-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 811 Bytes
/
Dockerfile
File metadata and controls
33 lines (21 loc) · 811 Bytes
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
FROM node:13-alpine AS builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh make gcc g++ python
COPY server/package*.json /usr/src/app/server/
RUN cd /usr/src/app/server && npm i
COPY client/package*.json /usr/src/app/client/
RUN cd /usr/src/app/client && npm i
COPY server/ /usr/src/app/server/
RUN cd /usr/src/app/server && npm run build
COPY client/ /usr/src/app/client/
RUN cd /usr/src/app/client && npm run build
FROM node:13-alpine
ENV NODE_ENV=production
WORKDIR /usr/src/app/server
COPY --from=builder /usr/src/app/client/build ../client/build
COPY --from=builder /usr/src/app/server/node_modules ./node_modules
COPY --from=builder /usr/src/app/server/dist dist
COPY --from=builder /usr/src/app/server/.env* ./
USER node
EXPOSE 8009
CMD ["node", "./dist/server"]