feat: token 令牌
This commit is contained in:
1 parent
a2ee53f83a
commit
ec0e6867ee
12 files changed
+408
-7
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
# Stage 1: Build Stage
|
||||
FROM node:20 AS builder
|
||||
|
||||
# Install pnpm globally
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package.json and pnpm-lock.yaml to the working directory
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Install all dependencies (including dev dependencies)
|
||||
RUN pnpm install
|
||||
|
||||
# Copy the rest of the application files
|
||||
COPY . .
|
||||
|
||||
# Build the NestJS application
|
||||
RUN pnpm run build
|
||||
|
||||
# Stage 2: Production Stage
|
||||
FROM node:20-alpine AS production
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy only the build output from the build stage
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Command to run the application
|
||||
CMD ["node", "dist/main"]
|
||||
Reference in new issue
Block a user