feat: optimize blog build and deployment
This commit is contained in:
+9
-2
@@ -2,12 +2,19 @@ FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG ENCRYPT_PASSWORD
|
||||
ENV ENCRYPT_PASSWORD=$ENCRYPT_PASSWORD
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
RUN --mount=type=cache,target=/root/.npm npm install --include=optional
|
||||
|
||||
COPY . .
|
||||
RUN npm run docs:build
|
||||
|
||||
FROM nginx:1.25-alpine
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY --from=build /app/src/.vuepress/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1
|
||||
|
||||
Reference in New Issue
Block a user