-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 878 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 878 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
38
39
#####
##### Docker multi-stage build : Node.js build image
#####
FROM node:lts-alpine as build-stage
# make the 'app' folder the current working directory
WORKDIR /app
# Copy project files and restore as distinct layers
COPY package.json ./
COPY package-lock.json ./
# install project dependencies
RUN npm install
# Copy everything else for build
COPY src/ ./src
COPY static/datas/ ./static/datas
COPY static/Models/ ./static/Models
COPY vite.config.js ./
COPY index.html ./
# Args
ARG VITE_FRONT_URI=$VITE_FRONT_URI
ARG VITE_FRONT_URL=$VITE_FRONT_URL
# build app for production with minification
RUN npm run build
# Data game
COPY static/ /app/dist/static
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]