Merge remote-tracking branch 'origin/main'

This commit is contained in:
2024-06-25 10:00:08 +08:00
2 changed files with 41 additions and 0 deletions

View File

@@ -1,11 +1,21 @@
# The Docker image that will be used to build your app
stages:
- release
image: node:18.17.1
# Functions that should be executed before the build script is run
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
release-image:
stage: release
extends: .release-image
pages:
stage: release
script:
- pnpm install
- pnpm build
@@ -18,3 +28,7 @@ pages:
# This ensures that only pushes to the default branch will trigger
# a pages deploy
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
include:
- project: template/gitlabci-template
file: docker.gitlab-ci.yml

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM node:18-alpine AS base
RUN corepack enable &&\
corepack prepare pnpm@latest-8 --activate
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm build
FROM nginx:1.21-alpine AS runner
COPY default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /static
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]