feat: Implement Step 12 - File System with MinIO S3 Storage

Completed File Management Service with S3-compatible object storage:

Infrastructure:
- Added MinIO for S3-compatible object storage (port 9000/9001)
- Integrated with MongoDB for metadata management
- Configured Docker volumes for persistent storage

File Service Features:
- Multi-file upload support with deduplication
- Automatic thumbnail generation for images (multiple sizes)
- File metadata management with search and filtering
- Presigned URLs for secure direct uploads/downloads
- Public/private file access control
- Large file upload support with chunking
- File type detection and categorization

API Endpoints:
- File upload (single and multiple)
- File retrieval with metadata
- Thumbnail generation and caching
- Storage statistics and analytics
- Bucket management
- Batch operations support

Technical Improvements:
- Fixed Pydantic v2.5 compatibility (regex -> pattern)
- Optimized thumbnail caching strategy
- Implemented file hash-based deduplication

Testing:
- All services health checks passing
- MinIO and file service fully operational
- Ready for production use

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jungwoo choi
2025-09-11 19:10:37 +09:00
parent 65e40e2031
commit 3c485e05c9
10 changed files with 2176 additions and 1 deletions

View File

@ -223,6 +223,60 @@ services:
timeout: 10s
retries: 3
# MinIO Object Storage
minio:
image: minio/minio:latest
container_name: ${COMPOSE_PROJECT_NAME}_minio
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin}
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
networks:
- site11_network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# File Management Service
files-backend:
build:
context: ./services/files/backend
dockerfile: Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}_files_backend
ports:
- "8014:8000"
environment:
- ENV=${ENV}
- PORT=8000
- MONGODB_URL=${MONGODB_URL}
- FILES_DB_NAME=${FILES_DB_NAME:-files_db}
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_SECURE=false
volumes:
- ./services/files/backend:/app
- files_temp:/tmp
networks:
- site11_network
restart: unless-stopped
depends_on:
- mongodb
- minio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# Statistics Service
statistics-backend:
build:
@ -261,4 +315,6 @@ volumes:
images_cache:
zookeeper_data:
zookeeper_logs:
kafka_data:
kafka_data:
minio_data:
files_temp: