Files
site11/services/files/backend/Dockerfile
jungwoo choi 3c485e05c9 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>
2025-09-11 19:10:37 +09:00

27 lines
596 B
Docker

FROM python:3.11-slim
WORKDIR /app
# Install system dependencies for Pillow and file type detection
RUN apt-get update && apt-get install -y \
gcc \
libmagic1 \
libjpeg-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create directories for thumbnails cache
RUN mkdir -p /tmp/thumbnails
# Expose port
EXPOSE 8000
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]