Mike0021 commited on
Commit
c27ec65
·
verified ·
1 Parent(s): 66fc3e7

Serve Gradio viewer with Docker runtime

Browse files
Files changed (3) hide show
  1. Dockerfile +23 -0
  2. README.md +2 -4
  3. app.py +5 -1
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV HF_HOME=/tmp/.cache/huggingface \
4
+ HF_MODULES_CACHE=/tmp/hf_modules \
5
+ MPLCONFIGDIR=/tmp/matplotlib \
6
+ GRADIO_ANALYTICS_ENABLED=False \
7
+ GRADIO_SSR_MODE=false \
8
+ PYTHONUNBUFFERED=1
9
+
10
+ WORKDIR /app
11
+
12
+ RUN apt-get update \
13
+ && apt-get install -y --no-install-recommends git \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ COPY requirements.txt .
17
+ RUN pip install --no-cache-dir --upgrade pip \
18
+ && pip install --no-cache-dir -r requirements.txt
19
+
20
+ COPY app.py .
21
+
22
+ EXPOSE 7860
23
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,10 +3,8 @@ title: Codex Traces
3
  emoji: 🚀
4
  colorFrom: gray
5
  colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 5.49.1
8
- python_version: 3.11
9
- app_file: app.py
10
  short_description: Visualize private Codex rollout logs
11
  startup_duration_timeout: 1h
12
  ---
 
3
  emoji: 🚀
4
  colorFrom: gray
5
  colorTo: indigo
6
+ sdk: docker
7
+ app_port: 7860
 
 
8
  short_description: Visualize private Codex rollout logs
9
  startup_duration_timeout: 1h
10
  ---
app.py CHANGED
@@ -1421,4 +1421,8 @@ demo = build_app()
1421
  print("codex-traces startup: demo ready", flush=True)
1422
 
1423
  print("codex-traces startup: launching", flush=True)
1424
- demo.launch(show_error=True)
 
 
 
 
 
1421
  print("codex-traces startup: demo ready", flush=True)
1422
 
1423
  print("codex-traces startup: launching", flush=True)
1424
+ demo.launch(
1425
+ server_name="0.0.0.0",
1426
+ server_port=int(os.environ.get("PORT", "7860")),
1427
+ show_error=True,
1428
+ )