Create Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM denoland/deno:alpine
|
| 2 |
+
|
| 3 |
+
# 创建工作目录
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# 复制所有文件
|
| 7 |
+
COPY . .
|
| 8 |
+
|
| 9 |
+
# 缓存主程序
|
| 10 |
+
# RUN deno cache subtitle.ts
|
| 11 |
+
RUN deno cache --allow-import web.ts
|
| 12 |
+
|
| 13 |
+
# 设置入口点,指向thunderapi子目录中的文件
|
| 14 |
+
ENTRYPOINT ["deno", "run", "--allow-net", "--allow-env", "--allow-read", "--allow-write","--allow-import", "web.ts"]
|
| 15 |
+
|
| 16 |
+
# 设置健康检查
|
| 17 |
+
# 健康检查 - 使用 wget(Alpine 默认包含)
|
| 18 |
+
# HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 19 |
+
# CMD wget --no-verbose --tries=1 --spider http://localhost:7860/headers || exit 1
|
| 20 |
+
|
| 21 |
+
# Hugging Face Spaces使用7860端口
|
| 22 |
+
EXPOSE 8000
|