Spaces:
Sleeping
Sleeping
Commit
·
9ac02b0
1
Parent(s):
c633463
Add Dockerfiles for main and fallback configurations
Browse files- Dockerfile +11 -0
- Dockerfile.fallback +14 -0
Dockerfile
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base image: AKTools official Docker image
|
| 2 |
+
FROM registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95
|
| 3 |
+
|
| 4 |
+
# Hugging Face Spaces injects PORT env var (default 7860)
|
| 5 |
+
ENV PORT=7860
|
| 6 |
+
|
| 7 |
+
# Expose the port for documentation
|
| 8 |
+
EXPOSE 7860
|
| 9 |
+
|
| 10 |
+
# Start aktools binding to 0.0.0.0 and the PORT env variable
|
| 11 |
+
CMD ["sh", "-c", "python -m aktools --host 0.0.0.0 --port ${PORT}"]
|
Dockerfile.fallback
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fallback Dockerfile: Build from scratch if China registry is unreachable
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Install aktools
|
| 5 |
+
RUN pip install --no-cache-dir aktools==1.8.95
|
| 6 |
+
|
| 7 |
+
# Hugging Face Spaces injects PORT env var (default 7860)
|
| 8 |
+
ENV PORT=7860
|
| 9 |
+
|
| 10 |
+
# Expose the port for documentation
|
| 11 |
+
EXPOSE 7860
|
| 12 |
+
|
| 13 |
+
# Start aktools binding to 0.0.0.0 and the PORT env variable
|
| 14 |
+
CMD ["sh", "-c", "python -m aktools --host 0.0.0.0 --port ${PORT}"]
|