forked from cadence-workflow/cadence-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 783 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
FROM node:fermium-bullseye AS BUILD_IMAGE
### Build step ###
WORKDIR /usr/build
# Bundle app source
COPY . .
# Install app dependencies
RUN npm install --production --unsafe-perm
# Bundle the client code
RUN npm run build-production
# switch to lite version of node
FROM node:fermium-bullseye-slim
### Run step ###
WORKDIR /usr/app
# copy from build image
COPY --from=BUILD_IMAGE /usr/build/server.js ./
COPY --from=BUILD_IMAGE /usr/build/webpack.config.js ./
COPY --from=BUILD_IMAGE /usr/build/dist ./dist
COPY --from=BUILD_IMAGE /usr/build/server ./server
COPY --from=BUILD_IMAGE /usr/build/node_modules ./node_modules
# setup production environment variables
ENV NODE_ENV=production
ENV NPM_CONFIG_PRODUCTION=true
# run node server
EXPOSE 8088
CMD [ "node", "server.js" ]