Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
|
@@ -1,17 +1,20 @@
|
|
| 1 |
# =============================================================================
|
| 2 |
-
# Sub2API
|
| 3 |
# =============================================================================
|
| 4 |
FROM ghcr.io/wei-shaw/sub2api:latest
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
| 7 |
COPY start-space.sh /app/start-space.sh
|
| 8 |
RUN chmod +x /app/start-space.sh
|
| 9 |
|
| 10 |
-
#
|
| 11 |
ENV SERVER_PORT=7860 \
|
| 12 |
TZ=Asia/Shanghai
|
| 13 |
|
| 14 |
-
# 健康检查(
|
| 15 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \
|
| 16 |
CMD wget -q -T 5 -O /dev/null http://localhost:${SERVER_PORT:-7860}/health || exit 1
|
| 17 |
|
|
|
|
| 1 |
# =============================================================================
|
| 2 |
+
# Sub2API - 官方最新镜像 + 自定义启动脚本
|
| 3 |
# =============================================================================
|
| 4 |
FROM ghcr.io/wei-shaw/sub2api:latest
|
| 5 |
|
| 6 |
+
# 创建软链接,让脚本中的 /app/hub-gateway 指向实际的 /app/sub2api
|
| 7 |
+
RUN ln -s /app/sub2api /app/hub-gateway
|
| 8 |
+
|
| 9 |
+
# 复制自定义启动脚本(覆盖官方默认脚本)
|
| 10 |
COPY start-space.sh /app/start-space.sh
|
| 11 |
RUN chmod +x /app/start-space.sh
|
| 12 |
|
| 13 |
+
# 覆盖或补充环境变量默认值(官方镜像已有合理默认值)
|
| 14 |
ENV SERVER_PORT=7860 \
|
| 15 |
TZ=Asia/Shanghai
|
| 16 |
|
| 17 |
+
# 健康检查(确保与您的端口一致)
|
| 18 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \
|
| 19 |
CMD wget -q -T 5 -O /dev/null http://localhost:${SERVER_PORT:-7860}/health || exit 1
|
| 20 |
|