From 2f42b26505a4603adfabef1916d712445b979483 Mon Sep 17 00:00:00 2001 From: Sipho Mkhwanazi Date: Wed, 18 Feb 2026 20:53:35 +0200 Subject: [PATCH] chore: apply latest project updates --- Makefile | 2 ++ README.md | 4 +++- docker-compose.yaml | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fb59bce..012b22a 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,12 @@ coverage: ## Run tests with coverage report demo-migrate: ## Run migrations for the demo project $(DC) up -d $(DB_SERVICE) $(API_SERVICE) + $(DC) exec -T $(DB_SERVICE) sh -lc 'until pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB" >/dev/null 2>&1; do echo "Waiting for Postgres..."; sleep 1; done' $(DC) exec $(API_SERVICE) python demo/manage.py migrate demo-run: ## Run demo stack in detached docker mode $(DC) up -d --build $(DB_SERVICE) $(API_SERVICE) + $(DC) exec -T $(DB_SERVICE) sh -lc 'until pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB" >/dev/null 2>&1; do echo "Waiting for Postgres..."; sleep 1; done' $(DC) exec $(API_SERVICE) python demo/manage.py migrate $(DC) exec $(API_SERVICE) python demo/manage.py seed_demo_data --reset diff --git a/README.md b/README.md index 13e6e92..7573937 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,9 @@ make demo-run Then: -- API root: `http://127.0.0.1:8010/api/` +- Catalog products API: `http://127.0.0.1:8010/api/catalog/products/` +- Checkout carts API: `http://127.0.0.1:8010/api/checkout/carts/` +- Promotions API: `http://127.0.0.1:8010/api/promotions/promotions/` - Create admin: `make superuser` - Admin dashboard: `http://127.0.0.1:8010/admin/` diff --git a/docker-compose.yaml b/docker-compose.yaml index a4d0845..9e5b71a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,6 +9,12 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-productory} ports: - "${POSTGRES_PORT:-5432}:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB} -h 127.0.0.1 -p 5432"] + interval: 5s + timeout: 3s + retries: 20 + start_period: 5s volumes: - ${POSTGRES_DATA_PATH:-./.data/postgres}:/var/lib/postgresql/data @@ -17,7 +23,8 @@ services: container_name: productory-demo restart: unless-stopped depends_on: - - productory-db + productory-db: + condition: service_healthy environment: DEMO_DB_ENGINE: ${DEMO_DB_ENGINE:-django.db.backends.postgresql} DEMO_DB_NAME: ${DEMO_DB_NAME:-productory}