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
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.venv
.vscode
.git
__pycache__
*.pyc
.ruff_cache
.mypy_cache
.pytest_cache
.claude
.github
26 changes: 7 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install ruff
run: pip install ruff
- uses: astral-sh/setup-uv@v5

- name: Check formatting
run: ruff format --check .
run: uvx ruff format --check .

- name: Run linter
run: ruff check .
run: uvx ruff check .

test:
name: Test
Expand Down Expand Up @@ -84,22 +79,15 @@ jobs:
with:
python-version: "3.14"

- name: Cache pipenv virtualenv
uses: actions/cache@v4
- uses: astral-sh/setup-uv@v5
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-

- name: Install pipenv
run: pip install pipenv
enable-cache: true

- name: Install dependencies
run: pipenv sync --dev --system
run: uv sync --dev

- name: Run tests
run: pytest
run: uv run pytest

- name: Upload coverage report
if: always()
Expand Down
28 changes: 19 additions & 9 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
FROM python:3.14-slim AS builder

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

WORKDIR /app

ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy

# Install production dependencies into .venv from lockfile.
# --no-install-project skips installing the app itself (not a package),
# enabling Docker layer caching: dep layer rebuilds only when lockfile changes.
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project

# ---- runtime image ----
FROM python:3.14-slim

WORKDIR /app

# Install Python production dependencies from lockfile.
# PIPENV_VENV_IN_PROJECT and PIPENV_IGNORE_VIRTUALENVS prevent pipenv from
# creating a virtualenv inside the container. --deploy fails the build if
# Pipfile.lock is out of sync with Pipfile.
COPY Pipfile Pipfile.lock ./
RUN pip install --no-cache-dir pipenv && \
PIPENV_VENV_IN_PROJECT=0 PIPENV_IGNORE_VIRTUALENVS=1 \
pipenv install --system --deploy && \
pip uninstall -y pipenv
# Copy the pre-built virtual environment (uv itself is not included)
COPY --from=builder /app/.venv /app/.venv

# Copy application code
COPY . .

ENV PATH="/app/.venv/bin:$PATH"

EXPOSE 8000

# Workers: 2 * CPU_count + 1 is the recommended starting point.
Expand Down
46 changes: 0 additions & 46 deletions Pipfile

This file was deleted.

Loading
Loading