vinm-base64 / Dockerfile
ChandraP12330's picture
Upload 4 files
681f7a5 verified
# Use a lightweight Python image
FROM python:3.12-slim
# Install uv from the official image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set working directory
WORKDIR /app
# Copy pyproject.toml to install dependencies first (caching)
COPY pyproject.toml .
# Install dependencies using uv sync
# This creates a virtual environment at /app/.venv
RUN uv sync --no-install-project
# Add the virtual environment to the PATH
ENV PATH="/app/.venv/bin:$PATH"
# Copy the rest of the application code
COPY . .
# Expose the port the app runs on
EXPOSE 7860
# Command to run the application
CMD ["uvicorn", "fastapi_app:app", "--host", "0.0.0.0", "--port", "7860"]