Skip to content

Commit 26cdbba

Browse files
committed
fix: Clean up dockerfile, fix setting api url to env
1 parent 02b622c commit 26cdbba

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

DockerfileFull

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
FROM nginx:mainline-alpine
1+
FROM node:16 as builder
22

33
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
145

156
# create folder and copy application into folder
16-
RUN mkdir G5V
17-
COPY ./ /G5V/
187
WORKDIR /G5V
8+
COPY package*.json .
9+
COPY yarn.lock .
1910

2011
# build application using yarn
21-
RUN yarn && yarn build
12+
RUN yarn
13+
14+
COPY . .
15+
16+
ENV NODE_ENV=production
2217

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

0 commit comments

Comments
 (0)