116 lines
2.7 KiB
YAML
116 lines
2.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: webref-postgres
|
|
environment:
|
|
POSTGRES_DB: webref
|
|
POSTGRES_USER: webref
|
|
POSTGRES_PASSWORD: webref_dev_password
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U webref"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- webref-network
|
|
|
|
# MinIO Object Storage
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: webref-minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin
|
|
ports:
|
|
- "9000:9000" # API
|
|
- "9001:9001" # Console UI
|
|
volumes:
|
|
- minio_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- webref-network
|
|
|
|
# MinIO Client - Create buckets on startup
|
|
minio-init:
|
|
image: minio/mc:latest
|
|
container_name: webref-minio-init
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
/usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin;
|
|
/usr/bin/mc mb myminio/webref --ignore-existing;
|
|
/usr/bin/mc policy set public myminio/webref;
|
|
exit 0;
|
|
"
|
|
networks:
|
|
- webref-network
|
|
|
|
# Redis (optional - for caching/background tasks)
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: webref-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- webref-network
|
|
|
|
# pgAdmin (optional - database management UI)
|
|
pgadmin:
|
|
image: dpage/pgadmin4:latest
|
|
container_name: webref-pgadmin
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: admin@webref.local
|
|
PGADMIN_DEFAULT_PASSWORD: admin
|
|
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
|
ports:
|
|
- "5050:80"
|
|
volumes:
|
|
- pgadmin_data:/var/lib/pgadmin
|
|
depends_on:
|
|
- postgres
|
|
networks:
|
|
- webref-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
minio_data:
|
|
driver: local
|
|
redis_data:
|
|
driver: local
|
|
pgadmin_data:
|
|
driver: local
|
|
|
|
networks:
|
|
webref-network:
|
|
driver: bridge
|
|
|
|
# Usage:
|
|
# Start all services: docker-compose -f docker-compose.dev.yml up -d
|
|
# Stop all services: docker-compose -f docker-compose.dev.yml down
|
|
# View logs: docker-compose -f docker-compose.dev.yml logs -f
|
|
# Reset volumes: docker-compose -f docker-compose.dev.yml down -v
|
|
|