PriceGhost/docker-compose.yml
clucraft 5263ac93a9 Add database initialization script
- 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>
2026-01-20 14:14:00 -05:00

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: