-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 756 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (27 loc) · 756 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 vue #########################
FROM node:12-buster-slim as builder
ENV VUE_HOME="/vue"
COPY ./vue $VUE_HOME
WORKDIR $VUE_HOME
RUN npm install
RUN npm run build
################## build image #######################
FROM node:12-buster-slim as production
ENV NODE_ENV=production \
SERVER_PATH="/server" \
PUBLIC_PATH="/server/vue-dist"
WORKDIR $SERVER_PATH
RUN apt-get update && \
apt-get -y install libcurl4 && \
apt-get -y autoremove && \
apt-get clean
# install npm package
COPY package*.json $SERVER_PATH/
RUN npm install --only=production
# copy server file
COPY ./ $SERVER_PATH/
COPY --from=builder /vue-dist $PUBLIC_PATH
EXPOSE 3000
# RUN
ENTRYPOINT ["script/docker-entrypoint.sh"]
CMD ["node","app.js"]