Skip to content

[INFRA 1] Containerise the stack: Dockerfiles for API and worker, docker-compose local dev, split requirements #154

Description

@m-khan-97

Objective

Make builds reproducible and local development one-command. Today there is no Dockerfile or docker-compose anywhere in the repo — Render builds implicitly from source, and every contributor assembles Python + Postgres + env vars by hand.

Current state

  • No Dockerfile, no docker-compose.yml, no .dockerignore
  • startup.sh runs the background worker as a subshell inside the same container as Gunicorn
  • A single requirements.txt mixes runtime, AI, and test dependencies — chromadb + sentence-transformers pull PyTorch (~2 GB) into the API image, inflating cold starts and memory on Render free tier

Scope

  • Multi-stage Dockerfile (python:3.11-slim) building the API image
  • Worker runs from the same image with a different entrypoint (python -m scanner.worker)
  • docker-compose.yml: postgres:16 + api + worker, with healthchecks and a .env.example
  • Split requirements: requirements/base.txt, ai.txt (chromadb, sentence-transformers), dev.txt (pytest) — AI deps become optional for the API image
  • .dockerignore (frontend/, website/, tests/, pycache, .env)
  • README quick-start updated to docker compose up

Out of scope

Acceptance criteria

  • docker compose up gives a working API on :5000 with migrations applied and worker polling
  • API image builds without AI/test dependencies
  • CI passes, base branch dev

Category

Infrastructure

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestinfraInfrastructure, CI/CD, deployment, and platform engineeringpriority: highImportant, should be fixed in the current sprint

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions