done
This commit is contained in:
128
docker-compose.yml
Normal file
128
docker-compose.yml
Normal file
@@ -0,0 +1,128 @@
|
||||
# Docker Compose for Secure Video & File Sharing Management System
|
||||
# Fully cross-platform: Runs natively on Linux (Ubuntu, Debian, CentOS) and Windows (Docker Desktop / WSL2)
|
||||
|
||||
services:
|
||||
# ==============================================================
|
||||
# MySQL Database (MySQL 8.0)
|
||||
# ==============================================================
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
container_name: fileshare-mysql
|
||||
restart: unless-stopped
|
||||
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: rootpassword
|
||||
MYSQL_DATABASE: fileshare_db
|
||||
MYSQL_USER: fileshare
|
||||
MYSQL_PASSWORD: fileshare_secure_pass
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# ==============================================================
|
||||
# Redis Queue & Caching (BullMQ)
|
||||
# ==============================================================
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: fileshare-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# ==============================================================
|
||||
# MinIO S3 Object Storage (Optional S3 Driver)
|
||||
# ==============================================================
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
container_name: fileshare-minio
|
||||
restart: unless-stopped
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadminpassword
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9001:9001"
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
|
||||
# ==============================================================
|
||||
# NestJS Backend API & Video Transcoding Engine
|
||||
# ==============================================================
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/backend/Dockerfile
|
||||
container_name: fileshare-backend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "4000:4000"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 4000
|
||||
FRONTEND_URL: http://localhost:3000
|
||||
DATABASE_URL: mysql://fileshare:fileshare_secure_pass@mysql:3306/fileshare_db
|
||||
JWT_ACCESS_SECRET: prod_access_secret_cross_platform_secure_2026_key
|
||||
JWT_ACCESS_EXPIRATION: 15m
|
||||
JWT_REFRESH_SECRET: prod_refresh_secret_cross_platform_secure_2026_key
|
||||
JWT_REFRESH_EXPIRATION: 7d
|
||||
# Filesystem storage: Native Linux volume inside container
|
||||
STORAGE_DRIVER: local
|
||||
LOCAL_STORAGE_PATH: /app/storage
|
||||
# Redis connection for video transcoding queue
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
# Initial Admin credentials for bootstrap seeder
|
||||
INITIAL_ADMIN_EMAIL: superadmin@fileshare.local
|
||||
INITIAL_ADMIN_USERNAME: superadmin
|
||||
INITIAL_ADMIN_PASSWORD: SuperAdmin@Secure2026!
|
||||
INITIAL_ADMIN_FULLNAME: Super Administrator
|
||||
volumes:
|
||||
# Persistent file storage volume (videos, files, thumbnails, HLS chunks)
|
||||
- storage_data:/app/storage
|
||||
|
||||
# ==============================================================
|
||||
# Next.js 15 Frontend
|
||||
# ==============================================================
|
||||
frontend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/frontend/Dockerfile
|
||||
container_name: fileshare-frontend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
NEXT_PUBLIC_API_URL: http://localhost:4000/api/v1
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
minio_data:
|
||||
driver: local
|
||||
storage_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user