Files
portfolio-infrastructure/docker-compose.yml
johnhkchen be7c37b3b0 Enable MinIO S3 storage with internal Docker network endpoint
Changes:
- Uncomment S3 storage configuration (lines 58-66)
- Set S3 endpoint to http://minio:9000 (internal Docker network)
- Configure S3 force path style for MinIO compatibility

This replaces the external endpoint (https://s3.b28.dev) with direct
container communication, avoiding Cloudflare Tunnel latency and
SSL/redirect issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 14:17:21 -07:00

89 lines
2.2 KiB
YAML

# Portfolio Infrastructure - Directus CMS
# Shared infrastructure for all portfolio demos
services:
# PostgreSQL Database for Directus
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_DB: directus
POSTGRES_USER: ${DB_USER:-directus}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-directus}"]
interval: 10s
timeout: 5s
retries: 5
# Directus CMS
directus:
image: directus/directus:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
# Database
DB_CLIENT: pg
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: directus
DB_USER: ${DB_USER:-directus}
DB_PASSWORD: ${DB_PASSWORD}
# Admin account
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
# Security
KEY: ${DIRECTUS_KEY}
SECRET: ${DIRECTUS_SECRET}
# Public URL - update for your deployment
PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8055}
# CORS - allow all origins for demo purposes
CORS_ENABLED: "true"
CORS_ORIGIN: "true"
# Storage - MinIO S3 (internal Docker network connection)
STORAGE_LOCATIONS: "s3"
STORAGE_S3_DRIVER: "s3"
STORAGE_S3_KEY: ${MINIO_ACCESS_KEY}
STORAGE_S3_SECRET: ${MINIO_SECRET_KEY}
STORAGE_S3_BUCKET: "directus-uploads"
STORAGE_S3_REGION: "us-east-1"
STORAGE_S3_ENDPOINT: "http://minio:9000"
STORAGE_S3_FORCE_PATH_STYLE: "true"
volumes:
- directus_uploads:/directus/uploads # Back to local storage temporarily
- directus_extensions:/directus/extensions
expose:
- "8055"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8055/server/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
name: directus_postgres_data
directus_uploads:
name: directus_uploads
directus_extensions:
name: directus_extensions