-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 663 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 663 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
34
35
36
37
# Build Stage
FROM node:carbon as build
RUN mkdir /tmp/app
WORKDIR /tmp/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# Bundle app source
COPY . .
RUN chown -R node ./
USER node
# Run App build within container context
RUN npm install
RUN npm prune --production
# Deployable Stage
FROM node:carbon
# Create app directory
WORKDIR /usr/src/app
COPY --from=build /tmp/app/node_modules ./node_modules
COPY --from=build /tmp/app/public ./public
COPY --from=build /tmp/app/build ./build
EXPOSE 3030
CMD [ "node", "./build/.core/index.js" ]