update building
This commit is contained in:
@@ -75,13 +75,12 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Build & restart (app only — keep DB running) ──
|
# ── Build & restart ──
|
||||||
cd "$DEPLOY_DIR"
|
cd "$DEPLOY_DIR"
|
||||||
docker compose up -d --build --no-deps db # ensure DB is running
|
docker compose build app
|
||||||
docker compose build app # rebuild app image
|
docker compose up -d --no-deps --force-recreate app
|
||||||
docker compose up -d --no-deps app # restart only app container
|
|
||||||
|
|
||||||
# ── Migrations ──
|
# ── Migrations (runs inside the container) ──
|
||||||
docker compose exec -T app alembic upgrade head
|
docker compose exec -T app alembic upgrade head
|
||||||
|
|
||||||
# ── Health check ──
|
# ── Health check ──
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /srv
|
||||||
|
|
||||||
# Install only psycopg2 build deps (needed for alembic sync driver)
|
# Install only psycopg2 build deps (needed for alembic sync driver)
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
|
|||||||
@@ -1,32 +1,7 @@
|
|||||||
services:
|
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:
|
app:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8001:8001"
|
- "8001:8001"
|
||||||
environment:
|
env_file: .env
|
||||||
DATABASE_URL: postgresql+asyncpg://waitlist:changeme@db:5432/waitlist_db
|
restart: unless-stopped
|
||||||
ALLOWED_ORIGINS: https://adiuvai.com,https://www.adiuvai.com
|
|
||||||
RATE_LIMIT_PER_MINUTE: 5
|
|
||||||
ENVIRONMENT: production
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
pgdata:
|
|
||||||
|
|||||||
Reference in New Issue
Block a user