Phase Plan: - 05-PLAN.md: Combined execution plan for efficiency - 05-RESEARCH.md: Domain research on volumes and MinIO Test Scripts (4): - 01-volumes-test.sh: Volume persistence verification - 02-minio-test.sh: MinIO S3 API testing - 03-persistence-test.sh: Database persistence verification - 99-final-verification.sh: End-to-end verification Documentation (6 files): Tutorial: Docker volumes, MinIO S3 How-to: Manage volumes Reference: Volume syntax Explanation: Storage↔S3 parallels Infrastructure: - docker-compose.yml: MinIO S3 + PostgreSQL + test container - Named volumes: minio-data, db-data, test-data (INF-04 compliant) Key concepts: - Named volumes = EBS volumes - MinIO = S3 bucket (100% API compatible) - Data persistence across container lifecycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83 lines
1.6 KiB
YAML
83 lines
1.6 KiB
YAML
# Lab 04: Storage & S3 - Docker Compose Configuration
|
|
# Simula storage S3-compatible con MinIO e Docker Volumes
|
|
|
|
version: "3.8"
|
|
|
|
services:
|
|
# MinIO - S3-compatible object storage
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: lab04-minio
|
|
hostname: minio
|
|
|
|
command: server /data --console-address ":9001"
|
|
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin123
|
|
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1'
|
|
memory: 1G
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
ports:
|
|
- "127.0.0.1:9000:9000" # API S3
|
|
- "127.0.0.1:9001:9001" # Console UI
|
|
|
|
volumes:
|
|
- minio-data:/data
|
|
|
|
restart: unless-stopped
|
|
|
|
# PostgreSQL con volume persistente
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: lab04-db
|
|
hostname: db
|
|
|
|
environment:
|
|
POSTGRES_DB: lab04_db
|
|
POSTGRES_USER: lab04_user
|
|
POSTGRES_PASSWORD: lab04_password
|
|
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1'
|
|
memory: 1G
|
|
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
|
|
restart: unless-stopped
|
|
|
|
# Test container - verifica persistenza
|
|
test:
|
|
image: alpine:3.19
|
|
container_name: lab04-test
|
|
hostname: test
|
|
|
|
command: ["sh", "-c", "sleep 3600"]
|
|
|
|
volumes:
|
|
- test-data:/test
|
|
|
|
restart: unless-stopped
|
|
|
|
# Named Volumes - Persistono oltre la vita dei container
|
|
volumes:
|
|
minio-data:
|
|
driver: local
|
|
db-data:
|
|
driver: local
|
|
test-data:
|
|
driver: local
|