Aasher commited on
Commit
2cb4410
·
1 Parent(s): 6375010

fix: Resolve uv Readme file error

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -22,14 +22,14 @@ RUN mkdir -p /.cache/uv
22
  # Copy only the pyproject.toml file first to leverage Docker layer caching
23
  COPY pyproject.toml .
24
 
25
- # Install Python dependencies using uv sync based on pyproject.toml
26
  RUN uv sync && \
27
  rm -rf /.uv
28
 
29
- # --- Non-Root User Setup ---
30
- # Create a non-root user 'user' with ID 1000 and create their home directory
31
- # Note: Cache was already cleaned, so no need to chown it here.
32
- RUN useradd -m -u 1000 user
33
  # Switch to the non-root user
34
  USER user
35
 
@@ -54,9 +54,7 @@ COPY --chown=user:user ./chainlit_ui.py ./chainlit_ui.py
54
  COPY --chown=user:user ./mcp.json ./mcp.json
55
  COPY --chown=user:user ./src ./src
56
  COPY --chown=user:user ./public ./public
57
- # If you have a .env file for local dev, ensure it's NOT copied (use .dockerignore)
58
- # Secrets should come from Hugging Face Secrets management
59
-
60
  # --- Runtime ---
61
  # Expose the port Chainlit will run on (standard HF Spaces port)
62
  EXPOSE 7860
 
22
  # Copy only the pyproject.toml file first to leverage Docker layer caching
23
  COPY pyproject.toml .
24
 
25
+ # Install Python packages as root using uv sync
26
  RUN uv sync && \
27
  rm -rf /.uv
28
 
29
+ # Create and switch to non-root user
30
+ RUN useradd -m -u 1000 user && \
31
+ chown -R user:user /.cache/uv
32
+
33
  # Switch to the non-root user
34
  USER user
35
 
 
54
  COPY --chown=user:user ./mcp.json ./mcp.json
55
  COPY --chown=user:user ./src ./src
56
  COPY --chown=user:user ./public ./public
57
+ COPY --chown=user:user ./README.md ./README.md
 
 
58
  # --- Runtime ---
59
  # Expose the port Chainlit will run on (standard HF Spaces port)
60
  EXPOSE 7860