root commited on
Commit
1fdd3a8
·
1 Parent(s): dd0c672
Files changed (3) hide show
  1. Dockerfile +16 -0
  2. entrypoint.sh +29 -0
  3. requirements.txt +50 -0
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ COPY requirements.txt /app/
6
+ COPY entrypoint.sh /app/
7
+
8
+ RUN apt-get update \
9
+ && apt-get install -y --no-install-recommends curl ca-certificates unzip \
10
+ && rm -rf /var/lib/apt/lists/* \
11
+ && pip install --no-cache-dir -r requirements.txt \
12
+ && chmod +x /app/entrypoint.sh
13
+
14
+ EXPOSE 7860
15
+
16
+ CMD ["/app/entrypoint.sh"]
entrypoint.sh ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ echo "[entrypoint] start..." >&2
5
+
6
+ if [ -z "${APP_ARCHIVE_URL:-}" ]; then
7
+ echo "[entrypoint] ERROR: APP_ARCHIVE_URL is not set." >&2
8
+ sleep 30
9
+ exit 1
10
+ fi
11
+
12
+ APP_DIR="/opt/app"
13
+ mkdir -p "$APP_DIR"
14
+ cd "$APP_DIR"
15
+
16
+ ARCHIVE_FILE="app_archive"
17
+
18
+ echo "[entrypoint] downloading..." >&2
19
+ curl -fsSL "$APP_ARCHIVE_URL" -o "$ARCHIVE_FILE"
20
+
21
+ echo "[entrypoint] extracting..." >&2
22
+ # 强制解压到当前目录
23
+ unzip -oq "$ARCHIVE_FILE" 2>/dev/null || tar -xzf "$ARCHIVE_FILE" 2>/dev/null
24
+
25
+ echo "[entrypoint] after extract:" >&2
26
+ ls -R .
27
+
28
+ echo "[entrypoint] launching app..." >&2
29
+ exec uvicorn app:app --host 0.0.0.0 --port 7860
requirements.txt ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotated-types==0.7.0
2
+ anyio==4.11.0
3
+ certifi==2025.10.5
4
+ cffi==2.0.0
5
+ charset-normalizer==3.4.3
6
+ click==8.3.0
7
+ curl-cffi==0.13.0
8
+ exceptiongroup==1.3.0
9
+ fastapi==0.118.0
10
+ filelock==3.19.1
11
+ fsspec==2025.9.0
12
+ gunicorn==23.0.0
13
+ h11==0.16.0
14
+ h2==4.3.0
15
+ hf-xet==1.1.10
16
+ hpack==4.1.0
17
+ httpcore==1.0.9
18
+ httpx==0.28.1
19
+ huggingface-hub==0.35.3
20
+ hyperframe==6.1.0
21
+ idna==3.10
22
+ importlib-resources==6.5.2
23
+ jinja2==3.1.6
24
+ markupsafe==3.0.3
25
+ nuitka==2.8
26
+ numpy==2.2.6
27
+ ordered-set==4.1.0
28
+ packaging==25.0
29
+ pip==23.0.1
30
+ pycparser==2.23
31
+ pycryptodome==3.23.0
32
+ pydantic==2.11.10
33
+ pydantic-core==2.33.2
34
+ pyyaml==6.0.3
35
+ regex==2025.9.18
36
+ requests==2.32.5
37
+ safetensors==0.6.2
38
+ setuptools==65.5.0
39
+ sniffio==1.3.1
40
+ starlette==0.48.0
41
+ tokenizers==0.22.1
42
+ tqdm==4.67.1
43
+ transformers==4.57.0
44
+ typing-extensions==4.15.0
45
+ typing-inspection==0.4.2
46
+ urllib3==2.5.0
47
+ uvicorn==0.37.0
48
+ uvloop==0.21.0
49
+ wasmtime==36.0.0
50
+ zstandard==0.25.0