Introducing Postgresql for persistance
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 32s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 32s
This commit is contained in:
@@ -1,16 +1,44 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: schoolcompare_db
|
||||
environment:
|
||||
POSTGRES_USER: schoolcompare
|
||||
POSTGRES_PASSWORD: schoolcompare
|
||||
POSTGRES_DB: schoolcompare
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U schoolcompare"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
app:
|
||||
build: .
|
||||
container_name: schoolcompare_app
|
||||
ports:
|
||||
- "80:80"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://schoolcompare:schoolcompare@db:5432/schoolcompare
|
||||
volumes:
|
||||
# Mount data directory for easy updates without rebuilding
|
||||
# Mount data directory for migrations
|
||||
- ./data:/app/data:ro
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:80/api/data-info"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user