修复网址数据服务器持久化存储

This commit is contained in:
rjb
2025-12-23 11:09:02 +08:00
parent e5a9b31a6c
commit cd8b30e0d4
15 changed files with 1755 additions and 20 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# 使用 Node.js 作为基础镜像
FROM node:18-alpine
WORKDIR /app
# 复制 package.json 并安装依赖
COPY package.json .
RUN npm install
# 复制服务器文件
COPY server.js .
# 创建 public 目录并复制静态文件
RUN mkdir -p public
COPY index.html public/
COPY script.js public/
COPY style.css public/
# 创建数据目录
RUN mkdir -p data
# 暴露端口
EXPOSE 3000
# 启动服务器
CMD ["node", "server.js"]