feat: init

This commit is contained in:
2024-08-06 16:14:45 +08:00
parent e9a475f2de
commit 511de1c9ae
22 changed files with 5868 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# 使用官方 Node.js 镜像
# FROM node:20-alpine AS builder
# 设置工作目录
# WORKDIR /usr/src/app
# 复制 package.json 和 package-lock.json
# COPY package.json ./
# 安装依赖
# RUN npm install
# 复制应用代码
# COPY . .
# 执行构建
# RUN npm run build
# 使用 Alpine 作为最终镜像
FROM node:20-alpine
# 设置工作目录
WORKDIR /usr/src/app
# 复制构建结果
COPY .next /usr/src/app/dist
# 安装 PM2
RUN npm install -g pm2
# 使用 PM2 启动应用
CMD ["node", "dist/standalone/server.js"]
# "start", "ecosystem.config.js"
# 暴露端口
EXPOSE 3000