HongzeFu commited on
Commit
18afa85
·
1 Parent(s): c56d129

docker v1

Browse files
Files changed (4) hide show
  1. .dockerignore +17 -0
  2. Dockerfile +13 -8
  3. README.md +15 -2
  4. docker-entrypoint.sh +2 -1
.dockerignore CHANGED
@@ -1,20 +1,37 @@
1
  .git
2
  .gitignore
 
 
3
  .venv
4
  .pytest_cache
5
  .mypy_cache
6
  .ruff_cache
7
  __pycache__
 
8
  *.pyc
9
  *.pyo
10
  *.pyd
11
 
 
 
 
12
  tests
 
 
 
 
 
13
  uv.lock
14
  temp_demos
 
15
  sample_run_videos
 
16
  gradio-web/logs
17
  gradio-web/server.pid
18
 
19
  assets
 
20
  doc
 
 
 
 
1
  .git
2
  .gitignore
3
+ .claude
4
+ .cursor
5
  .venv
6
  .pytest_cache
7
  .mypy_cache
8
  .ruff_cache
9
  __pycache__
10
+ **/__pycache__
11
  *.pyc
12
  *.pyo
13
  *.pyd
14
 
15
+ Untitled
16
+ app.py
17
+ human_readme.md
18
  tests
19
+ tests/
20
+ gradio-web/test
21
+ gradio-web/test/
22
+ gradio-web/scripts
23
+ gradio-web/scripts/
24
  uv.lock
25
  temp_demos
26
+ temp_demos/
27
  sample_run_videos
28
+ sample_run_videos/
29
  gradio-web/logs
30
  gradio-web/server.pid
31
 
32
  assets
33
+ assets/
34
  doc
35
+ doc/
36
+ scripts
37
+ scripts/
Dockerfile CHANGED
@@ -28,6 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
28
  && rm -f /tmp/get-pip.py \
29
  && rm -rf /var/lib/apt/lists/*
30
 
 
 
31
  ENV PYTHONUNBUFFERED=1 \
32
  PIP_NO_CACHE_DIR=1 \
33
  NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics \
@@ -36,20 +38,23 @@ ENV PYTHONUNBUFFERED=1 \
36
  OMP_NUM_THREADS=1 \
37
  PORT=7860
38
 
39
- RUN useradd -m -u 1000 user
40
  WORKDIR /home/user/app
41
  RUN mkdir -p /home/user/app/temp_demos \
42
- && chown user:user /home/user/app /home/user/app/temp_demos
 
 
43
 
44
- COPY --chown=user:user requirements.txt pyproject.toml README.md ./
45
- RUN python3 -m pip install --upgrade pip setuptools wheel \
46
- && python3 -m pip install -r requirements.txt
 
 
 
 
 
47
 
48
- COPY --chown=user:user . .
49
- RUN python3 -m pip install -e .
50
  RUN chmod +x /home/user/app/docker-entrypoint.sh
51
 
52
- USER user
53
  EXPOSE 7860
54
  ENTRYPOINT ["./docker-entrypoint.sh"]
55
 
 
28
  && rm -f /tmp/get-pip.py \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
+ RUN useradd -m -u 1000 user
32
+
33
  ENV PYTHONUNBUFFERED=1 \
34
  PIP_NO_CACHE_DIR=1 \
35
  NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics \
 
38
  OMP_NUM_THREADS=1 \
39
  PORT=7860
40
 
 
41
  WORKDIR /home/user/app
42
  RUN mkdir -p /home/user/app/temp_demos \
43
+ && chown -R user:user /home/user
44
+
45
+ COPY --chown=user:user requirements.txt ./
46
 
47
+ USER user
48
+
49
+ RUN python3 -m pip install --user --upgrade pip setuptools wheel \
50
+ && python3 -m pip install --user -r requirements.txt
51
+
52
+ COPY --chown=user:user docker-entrypoint.sh ./
53
+ COPY --chown=user:user gradio-web ./gradio-web
54
+ COPY --chown=user:user src ./src
55
 
 
 
56
  RUN chmod +x /home/user/app/docker-entrypoint.sh
57
 
 
58
  EXPOSE 7860
59
  ENTRYPOINT ["./docker-entrypoint.sh"]
60
 
README.md CHANGED
@@ -4,6 +4,19 @@ sdk: docker
4
  app_port: 7860
5
  ---
6
 
7
- This Space runs the RoboMME Gradio interface in single-instance session mode.
8
 
9
- Project docs are in `readme.md`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  app_port: 7860
5
  ---
6
 
7
+ This Space runs the RoboMME Gradio interface with the Docker SDK.
8
 
9
+ The container entrypoint is defined by the root `Dockerfile` and launches:
10
+
11
+ ```bash
12
+ python3 gradio-web/main.py
13
+ ```
14
+
15
+ `app_file` is intentionally not set here because this is a Docker Space; the application entrypoint comes from Docker `CMD`, while `app_port: 7860` is the external port published by the Space.
16
+
17
+ Local GPU Docker run:
18
+
19
+ ```bash
20
+ docker build -t robomme-gradio:gpu .
21
+ docker run --rm --gpus all -p 7860:7860 robomme-gradio:gpu
22
+ ```
docker-entrypoint.sh CHANGED
@@ -22,8 +22,9 @@ run_diagnostic() {
22
  echo "[entrypoint] $label"
23
  if "$@"; then
24
  return 0
 
 
25
  fi
26
- status=$?
27
  echo "[entrypoint] $label failed with exit code $status"
28
  return 0
29
  }
 
22
  echo "[entrypoint] $label"
23
  if "$@"; then
24
  return 0
25
+ else
26
+ status=$?
27
  fi
 
28
  echo "[entrypoint] $label failed with exit code $status"
29
  return 0
30
  }