fix: Resolve uv Readme file error
Browse files- 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
|
| 26 |
RUN uv sync && \
|
| 27 |
rm -rf /.uv
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 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 |
-
|
| 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
|