Skip to content

Commit fbc5ed7

Browse files
committed
add Dockerfile
1 parent 331dea1 commit fbc5ed7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
npm-debug.log
3+
Dockerfile
4+
docker
5+
.dockerignore

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:lts-alpine as build-stage
2+
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
3+
4+
WORKDIR /home/node/app
5+
6+
COPY package*.json ./
7+
8+
USER node
9+
10+
RUN npm install
11+
COPY --chown=node . .
12+
RUN npm run build
13+
14+
FROM nginx:stable-alpine as production-stage
15+
COPY --from=build-stage /home/node/app/dist /usr/share/nginx/html
16+
EXPOSE 80
17+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)