Update
Browse files12 unmodified lines1314151617181916 unmodified lines363738394041424344454647484950515253545556575859606162636465666768697071727312 unmodified linesUV_CACHE_DIR=/tmp/uv-cache \PORT=${PORT} \TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL} \HF_HOME=/home/appuser/.cache# Install system dependenciesRUN apt-get update && apt-get install -y \16 unmodified lines&& apt-get clean \&& rm -rf /var/lib/apt/lists/*# Create a non-root userRUN groupadd -r appuser && useradd -r -g appuser -m -s /bin/bash appuser# Set working directoryWORKDIR /home/appuser# Copy dependency files for better layer cachingCOPY --chown=appuser:appuser pyproject.toml uv.lock* ./# Copy external dependencies (submodules) needed for dependency resolutionCOPY --chown=appuser:appuser external/ ./external/# Install dependencies first (better caching)RUN --mount=type=cache,target=/tmp/uv-cache \uv sync --locked --no-install-project --no-dev# Copy the rest of the applicationCOPY --chown=appuser:appuser . .# Install the project in non-editable mode for productionRUN --mount=type=cache,target=/tmp/uv-cache \uv sync --locked --no-editable --no-dev# Create cache directories for Hugging Face with proper ownership (as root)RUN mkdir -p /home/appuser/.cache/hub && \chown -R appuser:appuser /home/appuser/.cache# Switch to non-root userUSER appuser# Add virtual environment to PATHENV PATH="/home/appuser/.venv/bin:$PATH"# Expose port (parameterized)EXPOSE ${PORT}12 unmodified lines1314151617181916 unmodified lines3637383940414243444546474849505152535455565758596061626364656612 unmodified linesUV_CACHE_DIR=/tmp/uv-cache \PORT=${PORT} \TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL} \HF_HOME=/app/.cache# Install system dependenciesRUN apt-get update && apt-get install -y \16 unmodified lines&& apt-get clean \&& rm -rf /var/lib/apt/lists/*# Set working directoryWORKDIR /app# Copy dependency files for better layer cachingCOPY pyproject.toml uv.lock* ./# Copy external dependencies (submodules) needed for dependency resolutionCOPY external/ ./external/# Install dependencies first (better caching)RUN --mount=type=cache,target=/tmp/uv-cache \uv sync --locked --no-install-project --no-dev# Copy the rest of the applicationCOPY . .# Install the project in non-editable mode for productionRUN --mount=type=cache,target=/tmp/uv-cache \uv sync --locked --no-editable --no-dev# Create cache directories for Hugging FaceRUN mkdir -p /app/.cache/hub# Add virtual environment to PATHENV PATH="/app/.venv/bin:$PATH"# Expose port (parameterized)EXPOSE ${PORT}
Dockerfile+8-15