Marc Skov Madsen commited on
Commit
f1cc92e
·
1 Parent(s): 84678e4
Files changed (1) hide show
  1. Dockerfile +20 -6
Dockerfile CHANGED
@@ -1,12 +1,26 @@
1
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
2
 
3
- ENV HOLOVIZ_MCP_USER_DIR=.
4
- COPY config.yaml config.yaml
5
- RUN mkdir -p /.cache/uv && chmod -R 777 /.cache
6
- RUN mkdir -p /.local/share/uv/tools && chmod -R 777 /.local
7
-
8
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  RUN uv tool install git+https://github.com/MarcSkovMadsen/holoviz-mcp[panel-extensions]
10
- RUN chmod -R +x /.local/share/uv/tools/*/bin/*
 
11
  # RUN uvx --from holoviz-mcp holoviz-mcp-update
 
12
  CMD ["uvx", "--from", "holoviz-mcp", "holoviz-mcp-serve", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*", "--num-procs", "2"]
 
1
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
2
 
3
+ # Install git for repository cloning
 
 
 
 
4
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5
+
6
+ # Set up a new user named "user" with user ID 1000 (required by Hugging Face Spaces)
7
+ RUN useradd -m -u 1000 user
8
+
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH \
15
+ HOLOVIZ_MCP_USER_DIR=/home/user/app
16
+
17
+ WORKDIR $HOME/app
18
+
19
+ COPY --chown=user config.yaml config.yaml
20
+
21
  RUN uv tool install git+https://github.com/MarcSkovMadsen/holoviz-mcp[panel-extensions]
22
+
23
+ # Run the update command
24
  # RUN uvx --from holoviz-mcp holoviz-mcp-update
25
+
26
  CMD ["uvx", "--from", "holoviz-mcp", "holoviz-mcp-serve", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*", "--num-procs", "2"]