Add production-ready docker file

This commit is contained in:
Matthias 2020-06-04 11:57:37 +02:00
parent 0e2be93a3d
commit 3fab329080
2 changed files with 22 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules/*

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM node:14.2.0-alpine as ui-builder
RUN mkdir /app
WORKDIR /app
# ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /app/package.json
RUN npm install
RUN npm install -g @vue/cli
COPY . /app
RUN npm run build
FROM nginx:alpine
COPY --from=ui-builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]