A dockerised starter stack containing the following components:
- LiteStar backend
- Granian Server via https://github.com/cofin/litestar-granian
- Postgres database
- Piccolo ORM (Async)
- Msgspec Validations
- Generic Model Base Class
- Generic Crud Controller generator
-
Clone repo:
git clone [email protected]:pavdwest/docker_litestar_piccolo_pg.git -
Create .env file and populate with your own secrets:
cp docker_litestar_piccolo_pg/.env.example docker_litestar_piccolo_pg/.env -
Enter app directory:
cd docker_litestar_piccolo_pg/services/backend/app -
Create & activate virtual environment (only required for local development):
uv venv .venv && source .venv/bin/activate && uv sync -
Run stack (we attach only to the backend to ignore other containers' log spam):
docker compose up --build --attach backend -
Everything's running:
-
Run migrations with Piccolo migrations:
TODO
-
Run tests:
docker compose exec backend pytest