initial commit
This commit is contained in:
20
server/Dockerfile
Normal file
20
server/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
# 使用 Node.js 官方镜像
|
||||
FROM node:20-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 拷贝依赖清单
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装依赖(只安装生产依赖即可)
|
||||
RUN npm install --production
|
||||
|
||||
# 拷贝源码
|
||||
COPY . .
|
||||
|
||||
# 暴露 WebSocket 端口
|
||||
EXPOSE 8080
|
||||
|
||||
# 启动命令
|
||||
CMD ["node", "index.js"]
|
||||
Reference in New Issue
Block a user