blanchon commited on
Commit
9c4d985
·
1 Parent(s): e37f31f
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -13,8 +13,8 @@ ENV PYTHONUNBUFFERED=1 \
13
  UV_CACHE_DIR=/tmp/uv-cache \
14
  PORT=${PORT} \
15
  TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL} \
16
- HF_HOME=/home/appuser/.cache
17
-
18
  # Install system dependencies
19
  RUN apt-get update && apt-get install -y \
20
  # Build tools for compiling Python packages
@@ -53,19 +53,19 @@ RUN --mount=type=cache,target=/tmp/uv-cache \
53
  uv sync --locked --no-install-project --no-dev
54
 
55
  # Copy the rest of the application
56
- COPY --chown=appuser:appuser . /app/.cache/transformers /app/.cache/datasets .
57
 
58
  # Install the project in non-editable mode for production
59
  RUN --mount=type=cache,target=/tmp/uv-cache \
60
- uv syncno-editable transformers /app/.cache/datasets /app/.cache/--n /app/.cache/torcho-dev
 
 
 
 
61
 
62
  # Switch to non-root user
63
  USER appuser
64
 
65
- # Create cache directgging Face itransformers /app/.cche/datasets /app/.cache/n us/app/.cache/torch er home directory
66
- RUN mkdir -p /home/appuser/.cache/hub
67
- RUN chown -R appuser:appuser /home/appuser/.cache
68
-
69
  # Add virtual environment to PATH
70
  ENV PATH="/app/.venv/bin:$PATH"
71
 
 
13
  UV_CACHE_DIR=/tmp/uv-cache \
14
  PORT=${PORT} \
15
  TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL} \
16
+ HF_HOME=/app/.cache
17
+
18
  # Install system dependencies
19
  RUN apt-get update && apt-get install -y \
20
  # Build tools for compiling Python packages
 
53
  uv sync --locked --no-install-project --no-dev
54
 
55
  # Copy the rest of the application
56
+ COPY --chown=appuser:appuser . .
57
 
58
  # Install the project in non-editable mode for production
59
  RUN --mount=type=cache,target=/tmp/uv-cache \
60
+ uv sync --locked --no-editable --no-dev
61
+
62
+ # Create cache directories for Hugging Face with proper ownership
63
+ RUN mkdir -p /app/.cache/hub && \
64
+ chown -R appuser:appuser /app/.cache
65
 
66
  # Switch to non-root user
67
  USER appuser
68
 
 
 
 
 
69
  # Add virtual environment to PATH
70
  ENV PATH="/app/.venv/bin:$PATH"
71