diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc5aefe..bf48509 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,26 +60,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - run_install: false - - - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Package - run: bash ./patch-ui-pro.zsh - - - name: Build - run: pnpm run build - + # 1. 登录 registry - name: Login to private registry uses: docker/login-action@v3 diff --git a/.npmrc b/.npmrc index f647d71..c862454 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,2 @@ shamefully-hoist=true -corepack-default-registry=https://registry.npmmirror.com COREPACK_NPM_REGISTRY=https://registry.npmmirror.com \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 214ac06..1f733c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,27 @@ -FROM node:22-slim AS build +FROM node:22-alpine WORKDIR /app +# RUN npm config set registry https://registry.npmmirror.com +RUN corepack enable + +# Copy package.json and your lockfile, here we add pnpm-lock.yaml for illustration +# COPY package.json pnpm-lock.yaml .npmrc ./ + +COPY . ./ + +# Install dependencies +RUN pnpm i + # Copy the entire project -COPY .output ./.output +# Build the project +RUN chmod +x patch-ui-pro.zsh && ./patch-ui-pro.zsh +RUN pnpm run build # Change the port and host ENV PORT=3000 ENV HOST=0.0.0.0 +EXPOSE 3000 + CMD ["node", ".output/server/index.mjs"] \ No newline at end of file