-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.release
executable file
·71 lines (45 loc) · 1.22 KB
/
Dockerfile.release
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
67
68
69
70
71
# # Build Stage 1
# # This build created a staging docker image
# #
# FROM node:14-alpine AS appbuild
# LABEL Maintainer="Firman Abdul Hakim <[email protected]>" \
# Description="Nodejs Expressjs"
# WORKDIR /usr/src/app
# COPY package.json ./
# # COPY .babelrc ./
# RUN yarn install --silent && yarn cache clean --all
# COPY ./src ./src
# RUN ["yarn", "dev"]
# # Build Stage 2
# # This build takes the production build from staging build
# #
# FROM node:14-alpine
# WORKDIR /usr/src/app
# COPY package.json ./
# # COPY .babelrc ./
# RUN npm install
# COPY --from=appbuild /usr/src/app/dist ./dist
# EXPOSE 4002
# CMD yarn start
# Build Stage 1
# This build created a staging docker image
#
FROM node:14-alpine AS appbuild
LABEL Maintainer="Firman Abdul Hakim <[email protected]>" \
Description="Nodejs Expressjs"
WORKDIR /usr/apps
COPY package.json ./
# COPY .babelrc ./
RUN yarn install
#copy source
COPY . .
# Build Stage 2
# This build takes the production build from staging build
#
FROM node:14-alpine
WORKDIR /usr/apps
COPY package.json ./
# COPY .babelrc ./
RUN yarn install
COPY --from=appbuild /usr/apps/ ./
RUN ["yarn", "dev"]