summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 240058403ae7dee9ea4f0795e198b36e2a3a6a2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json ./

# environment variables
# used by Vue.js app as `process.env.<name>` into the views/components
ARG BACKEND_URL

RUN npm install
RUN npx browserslist@latest --update-db
COPY . .
RUN npm run build && npm run generate

# production stage
FROM nginx:stable-alpine as production-stage
COPY ./nginx.conf /temp/prod.conf
RUN envsubst /app < /temp/prod.conf > /etc/nginx/conf.d/default.conf
COPY --from=build-stage /app/dist/ /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]