-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (34 loc) · 1 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
############################################
### APP BUILD STAGE
############################################
FROM node:dubnium AS appbuild
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
COPY package-lock.json /usr/src/app/
RUN npm ci
# Build app
COPY tslint.json tsconfig.json /usr/src/app/
COPY src /usr/src/app/src
RUN npm run build
# Install app production dependencies
RUN rm -rf node_modules && \
npm ci --production && \
npm cache clean --force
############################################
### IMAGE BUILD STAGE
############################################
FROM node:dubnium
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
COPY --from=appbuild /usr/src/app/node_modules /usr/src/app/node_modules
# Bundle app source
COPY --from=appbuild /usr/src/app/dist /usr/src/app/dist
COPY config /usr/src/app/config
EXPOSE 3000
CMD [ "node", "dist" ]