feat: 修改部署方式
This commit is contained in:
21
scripts/Dockerfile
Normal file
21
scripts/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM alpine:3.22 AS base
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache --update nodejs pnpm
|
||||
|
||||
FROM base AS install
|
||||
ENV NODE_ENV=production
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install
|
||||
|
||||
FROM install AS build
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
FROM base
|
||||
COPY --from=install /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=4321
|
||||
EXPOSE 4321
|
||||
CMD ["node", "./dist/server/entry.mjs"]
|
||||
Reference in New Issue
Block a user