Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Python / Environment
venv
.venv
__pycache__
*.pyc
.pytest_cache
Expand All @@ -13,7 +14,7 @@ pytest.ini

# Testing & Dev
tests
requirements-dev.txt
requirements.txt
.pre-commit-config.yaml
.github

Expand All @@ -35,5 +36,3 @@ LICENSE
# Heavy Assets & Tooling
examples
tools
uv.lock
.python-version
22 changes: 20 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
FROM python:3.13-slim

# 1. Install 'uv' from the official image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Prevent Python from writing pyc files and buffering stdout
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 2. Copy dependency files first (for Docker layer caching)
COPY pyproject.toml uv.lock ./

# 3. Install dependencies using uv
# --frozen: fail if the lockfile is out of sync
# --no-dev: production only (skips pytest, ruff, etc.)
# --no-install-project: install libs first, project code comes later
RUN uv sync --frozen --no-dev --no-install-project

# 4. Copy the rest of the application
COPY . .

# 5. Add the virtual environment to PATH
# uv creates the venv at /app/.venv by default
ENV PATH="/app/.venv/bin:$PATH"

EXPOSE 8501

# Note: Ensure 'curl' is installed if you keep this healthcheck,
# as python:slim images often lack it.
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]