feat: support NAS imports and proxy names
This commit is contained in:
+12
-12
@@ -1,24 +1,24 @@
|
||||
FROM node:22-alpine
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 复制依赖配置并安装
|
||||
ENV NODE_ENV=production \
|
||||
HOST=0.0.0.0 \
|
||||
PORT=3000 \
|
||||
AUTO_OPEN=0
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install --production
|
||||
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi
|
||||
|
||||
# 复制其余的项目代码
|
||||
COPY sub2proxy.js ./
|
||||
COPY public/ ./public/
|
||||
COPY templates/ ./templates/
|
||||
COPY public ./public
|
||||
COPY templates ./templates
|
||||
|
||||
# 创建持久化存储的目录与文件
|
||||
RUN mkdir -p out
|
||||
RUN mkdir -p out && printf '[]\n' > subs.json
|
||||
|
||||
# 暴露 3000 端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 环境变量:让服务不自动在后台执行浏览器拉起命令
|
||||
ENV HEADLESS=true
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD node -e "require('http').get('http://127.0.0.1:'+(process.env.PORT||3000)+'/api/health',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"
|
||||
|
||||
# 启动服务
|
||||
CMD ["node", "sub2proxy.js"]
|
||||
|
||||
Reference in New Issue
Block a user