From 35f4cf43ccb8e70c7e569c170e70277903493689 Mon Sep 17 00:00:00 2001 From: Kai Chappell Date: Fri, 30 May 2025 20:00:49 +0100 Subject: [PATCH] fix docker build missing readme --- backend/Dockerfile | 10 ++++++++-- backend/readme.md | 30 ++++-------------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index cc14028..52d1634 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -6,11 +6,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* -COPY pyproject.toml . +COPY pyproject.toml readme.md ./ RUN pip install --no-cache-dir . -COPY . . +# Create non-root user for security +RUN addgroup --system --gid 1001 python && \ + adduser --system --uid 1001 --gid 1001 appuser + +COPY --chown=appuser:python . . + +USER appuser EXPOSE 8000 diff --git a/backend/readme.md b/backend/readme.md index 453a2c9..51be47a 100644 --- a/backend/readme.md +++ b/backend/readme.md @@ -5,39 +5,17 @@ FastAPI backend for the CodeTutor coding interview preparation application. ## Setup ```bash -# Install dependencies pip install -e ".[dev]" - -# Run migrations -alembic upgrade head - -# Load content data -python scripts/load_data.py - -# Start development server -uvicorn src.main:app --reload ``` -## API Endpoints +## Development -- `GET /api/questions` - List questions with filters -- `GET /api/questions/{slug}` - Question detail -- `GET /api/categories` - List categories -- `GET /api/patterns` - List patterns -- `GET /api/patterns/{slug}` - Pattern detail -- `GET /api/stats` - Aggregate statistics -- `GET /api/health` - Health check +```bash +uvicorn src.main:app --reload +``` ## Testing ```bash pytest ``` - -## Code Quality - -```bash -ruff check . -ruff format --check . -mypy src/ -```