File tree 2 files changed +18
-16
lines changed
2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
Original file line number Diff line number Diff line change 1
- FROM nginx:mainline-alpine
1
+ FROM node:16 as builder
2
2
3
3
ARG VUE_APP_G5V_API_URL
4
- RUN touch .env.production
5
- RUN echo $VUE_APP_G5V_API_URL < .env.production
6
-
7
- # install prerequisits
8
- RUN apk update && apk add \
9
- nodejs \
10
- yarn
11
-
12
- # Move default.conf into /etc/nginx/conf.d/
13
- COPY default.conf /etc/nginx/conf.d/default.conf
4
+ ENV VUE_APP_G5V_API_URL=$VUE_APP_G5V_API_URL
14
5
15
6
# create folder and copy application into folder
16
- RUN mkdir G5V
17
- COPY ./ /G5V/
18
7
WORKDIR /G5V
8
+ COPY package*.json .
9
+ COPY yarn.lock .
19
10
20
11
# build application using yarn
21
- RUN yarn && yarn build
12
+ RUN yarn
13
+
14
+ COPY . .
15
+
16
+ ENV NODE_ENV=production
22
17
23
- # copy results to nginx directory
24
- RUN cp -R ./dist/* /usr/share/nginx/html
18
+ RUN yarn build
19
+
20
+
21
+ FROM nginx:latest
22
+
23
+ # Move default.conf into /etc/nginx/conf.d/
24
+ COPY default.conf /etc/nginx/conf.d/default.conf
25
+ COPY --from=builder /G5V/dist /usr/share/nginx/html
You can’t perform that action at this time.
0 commit comments