Update
Browse files12 unmodified lines131415161617181916 unmodified lines36373839404139434041424643444549464748495051525653545556575862636465666759606162706364656612 unmodified lines UV_CACHE_DIR=/tmp/uv-cache \ PORT=${PORT} \ TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL} \ HF_HOME=/home/appuser/.cache 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/*
# Create a non-root userRUN groupadd -r appuser && useradd -r -g appuser -m -s /bin/bash appuser
# Set working directoryWORKDIR /home/appuserWORKDIR /app
# Copy dependency files for better layer cachingCOPY --chown=appuser:appuser pyproject.toml uv.lock* ./COPY pyproject.toml uv.lock* ./
# Copy external dependencies (submodules) needed for dependency resolutionCOPY --chown=appuser:appuser external/ ./external/COPY 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 . .COPY . .
# 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# Create cache directories for Hugging FaceRUN mkdir -p /app/.cache/hub
# Add virtual environment to PATHENV PATH="/home/appuser/.venv/bin:$PATH"ENV PATH="/app/.venv/bin:$PATH"
# Expose port (parameterized)EXPOSE ${PORT}Dockerfile+8-15