添加docker镜像等服务
This commit is contained in:
23
Dockerfile.simple
Normal file
23
Dockerfile.simple
Normal file
@@ -0,0 +1,23 @@
|
||||
# 简化的单阶段构建(适用于开发环境)
|
||||
FROM node:18-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制所有文件
|
||||
COPY . .
|
||||
|
||||
# 安装后端依赖
|
||||
RUN npm ci
|
||||
|
||||
# 安装前端依赖并构建
|
||||
RUN cd frontend && npm ci && npm run build
|
||||
|
||||
# 构建后端
|
||||
RUN npm run build:server
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动应用
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user