-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (26 loc) · 775 Bytes
/
Dockerfile
File metadata and controls
39 lines (26 loc) · 775 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
FROM node:18.6.0-alpine AS build
# For handling Kernel signals properly
RUN apk add --no-cache git
# Set the default working directory for the app
WORKDIR /usr/src/app
# Copy package.json, package-lock.json
COPY package*.json ./
# Install dependencies.
RUN npm ci
# Necessary to run before adding application code to leverage Docker cache
RUN npm cache clean --force
# Add src project
ADD . .
# Build project
RUN npm run build
# nginx production environment
FROM nginx:stable-alpine AS deploy
WORKDIR /usr/src/app
# Copy build directory
COPY --from=build /usr/src/app/.vitepress/dist /usr/share/nginx/html
# copy nginx confiuration file
COPY .ci/nginx.conf /etc/nginx/conf.d/default.conf
# expose port 80
EXPOSE 80
# Run nginx
CMD ["nginx", "-g", "daemon off;"]