mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-04-25 08:46:23 +02:00
- Add database/init.sql with schema - Mount init.sql in docker-compose for auto-initialization - PostgreSQL will run this on first startup Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: priceghost-db
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: priceghost
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# Backend API
|
|
backend:
|
|
image: ghcr.io/clucraft/priceghost-backend:latest
|
|
container_name: priceghost-backend
|
|
environment:
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/priceghost
|
|
JWT_SECRET: ${JWT_SECRET:-change-this-in-production-use-strong-secret}
|
|
PORT: 3001
|
|
NODE_ENV: production
|
|
ports:
|
|
- "3001:3001"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# Frontend
|
|
frontend:
|
|
image: ghcr.io/clucraft/priceghost-frontend:latest
|
|
container_name: priceghost-frontend
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|