# Development Infrastructure # This docker-compose.yml starts only infrastructure services (postgres, minio) # The API service runs locally via `pnpm dev` for hot reload services: # PostgreSQL Database postgres: image: postgres:15-alpine container_name: banatie-postgres-dev ports: - "5460:5432" volumes: - ../../data/postgres:/var/lib/postgresql/data - ../../scripts/init-db.sql:/docker-entrypoint-initdb.d/01-init.sql networks: - banatie-dev-network environment: POSTGRES_DB: banatie_db POSTGRES_USER: banatie_user POSTGRES_PASSWORD: banatie_secure_password healthcheck: test: ["CMD-SHELL", "pg_isready -U banatie_user -d banatie_db"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped # MinIO Object Storage - SNMD Mode minio: image: quay.io/minio/minio:latest container_name: banatie-storage-dev ports: - "9000:9000" # S3 API - "9001:9001" # Web Console volumes: # SNMD: 4 drives for full S3 compatibility - ../../data/storage/drive1:/data1 - ../../data/storage/drive2:/data2 - ../../data/storage/drive3:/data3 - ../../data/storage/drive4:/data4 networks: - banatie-dev-network environment: MINIO_ROOT_USER: banatie_admin MINIO_ROOT_PASSWORD: banatie_storage_secure_key_2024 MINIO_BROWSER_REDIRECT_URL: http://localhost:9001 MINIO_SERVER_URL: http://localhost:9000 MINIO_DOMAIN: localhost command: server /data{1...4} --console-address ":9001" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped # MinIO Storage Initialization storage-init: image: minio/mc:latest container_name: banatie-storage-init-dev networks: - banatie-dev-network depends_on: minio: condition: service_healthy entrypoint: - /bin/sh - -c - | echo 'Setting up MinIO alias...' mc alias set storage http://minio:9000 banatie_admin banatie_storage_secure_key_2024 echo 'Creating main bucket...' mc mb --ignore-existing storage/banatie echo 'Creating service user...' mc admin user add storage banatie_service banatie_service_key_2024 echo 'Attaching readwrite policy to service user...' mc admin policy attach storage readwrite --user=banatie_service echo 'Setting up lifecycle policy...' cat > /tmp/lifecycle.json <<'LIFECYCLE' { "Rules": [ { "ID": "temp-cleanup", "Status": "Enabled", "Filter": { "Prefix": "temp/" }, "Expiration": { "Days": 7 } } ] } LIFECYCLE mc ilm import storage/banatie < /tmp/lifecycle.json echo 'Storage initialization completed!' echo 'Bucket: banatie' echo 'Dev mode: API service will connect via localhost:9000' exit 0 restart: "no" networks: banatie-dev-network: driver: bridge