Commit fc48bbd1 authored by root's avatar root
Browse files

dockerfile

parent d07b4bc6
node_modules
.next
.git
.env
*.log
Dockerfile
.dockerignore
\ No newline at end of file
# 使用官方 Node.js 基础镜像
FROM node:18-alpine
# 设置工作目录
WORKDIR /app
# 复制包管理文件(优先复制以利用 Docker 缓存)
COPY package.json pnpm-lock.yaml ./
# 安装 pnpm 和依赖
RUN npm install -g pnpm && \
pnpm install --frozen-lockfile
# 复制所有项目文件
COPY . .
# 生成 Prisma 客户端
RUN pnpm prisma generate
# 构建 Next.js 应用
RUN pnpm build
# 暴露端口(Next.js 默认 3000)
EXPOSE 3000
# 启动命令
CMD ["pnpm", "start"]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment