FROM python:3.12-slim-trixie # System deps for the installer RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/* # Download the latest uv installer ADD https://astral.sh/uv/install.sh /uv-installer.sh # Run the installer then remove it RUN sh /uv-installer.sh && rm /uv-installer.sh # Ensure the installed binary is on the PATH ENV PATH="/root/.local/bin:${PATH}" # Set the work directory inside the container WORKDIR /app # Copy only dependency files first for better build cache usage # Adjust these if your project uses different names COPY pyproject.toml uv.lock* ./ # Install project dependencies into a project local virtual environment RUN uv sync --frozen --no-dev # Now copy the rest of the project COPY . . ENV VELAI_HOST="0.0.0.0" ENV VELAI_PORT=7860 EXPOSE 7860 # Default command to start your app CMD ["uv", "run", "--no-sync", "--no-dev", "python", "main.py"]