Skip to content

Commit

Permalink
refactor: update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zyronon committed May 1, 2024
1 parent bbbb9ba commit 6bf2dfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.DS_Store
coverage
*.local

dist
node_modules
.vscode/*
!.vscode/extensions.json
.idea
Expand All @@ -20,4 +22,4 @@ coverage
*.sln
*.sw?
docs
node
node
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /src
COPY ./ ./
WORKDIR /app
COPY . .

# RUN两次方便观察install和build, 也可以用pnpm cache and locked
RUN pnpm install
RUN npm run build

FROM --platform=${BUILDPLATFORM:-linux/amd64,linux/arm64} ghcr.io/rookie-luochao/nginx-runner:latest

COPY --from=builder /src/dist /app
COPY --from=builder /app/dist .

0 comments on commit 6bf2dfe

Please sign in to comment.