From 77e02b4e863999cb197559205e5b9622548f6938 Mon Sep 17 00:00:00 2001 From: Roberto Musso Date: Sat, 11 Apr 2026 14:41:16 +0200 Subject: [PATCH] update building --- .gitea/workflows/deploy.yaml | 9 ++++----- Dockerfile | 2 +- docker-compose.yml | 29 ++--------------------------- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 832de75..a26d4ec 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -75,13 +75,12 @@ jobs: exit 1 fi - # ── Build & restart (app only — keep DB running) ── + # ── Build & restart ── cd "$DEPLOY_DIR" - docker compose up -d --build --no-deps db # ensure DB is running - docker compose build app # rebuild app image - docker compose up -d --no-deps app # restart only app container + docker compose build app + docker compose up -d --no-deps --force-recreate app - # ── Migrations ── + # ── Migrations (runs inside the container) ── docker compose exec -T app alembic upgrade head # ── Health check ── diff --git a/Dockerfile b/Dockerfile index 3d7302b..ccf82a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.12-slim -WORKDIR /app +WORKDIR /srv # Install only psycopg2 build deps (needed for alembic sync driver) RUN apt-get update && \ diff --git a/docker-compose.yml b/docker-compose.yml index ecc2b88..e4961ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,32 +1,7 @@ services: - db: - image: postgres:16-alpine - environment: - POSTGRES_USER: waitlist - POSTGRES_PASSWORD: changeme - POSTGRES_DB: waitlist_db - ports: - - "5433:5432" - volumes: - - pgdata:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready -U waitlist -d waitlist_db"] - interval: 5s - timeout: 3s - retries: 5 - app: build: . ports: - "8001:8001" - environment: - DATABASE_URL: postgresql+asyncpg://waitlist:changeme@db:5432/waitlist_db - ALLOWED_ORIGINS: https://adiuvai.com,https://www.adiuvai.com - RATE_LIMIT_PER_MINUTE: 5 - ENVIRONMENT: production - depends_on: - db: - condition: service_healthy - -volumes: - pgdata: + env_file: .env + restart: unless-stopped