feat(docker): Add Storage Service configuration to docker-compose

- Introduced the Storage Service .NET configuration in the local docker-compose.yml, enabling file storage management with external MinIO and Redis integration.
- Updated environment variables for database connection, storage provider, and IAM service communication.
- Configured health checks and Traefik routing for the new service.
This commit is contained in:
Ho Ngoc Hai
2026-01-13 19:53:59 +07:00
parent e07a294f2d
commit ca18df6a2c

View File

@@ -62,46 +62,59 @@ services:
# BACKEND SERVICES
# ===========================================================================
# Storage Service .NET - DISABLED (requires MinIO)
# storage-service:
# build:
# context: ../..
# dockerfile: services/storage-service-net/Dockerfile
# container_name: storage-service-local
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ConnectionStrings__DefaultConnection=${STORAGE_DATABASE_URL:-Host=localhost;Port=5432;Database=storage_db;Username=postgres;Password=postgres}
# - Storage__Provider=${STORAGE_PROVIDER:-minio}
# - Storage__DefaultBucket=${STORAGE_DEFAULT_BUCKET:-storage}
# - Storage__MinIO__Endpoint=minio:9000
# - Storage__MinIO__AccessKey=${MINIO_ACCESS_KEY:-minioadmin}
# - Storage__MinIO__SecretKey=${MINIO_SECRET_KEY:-minioadmin}
# - Storage__MinIO__UseSSL=false
# - IamService__BaseUrl=http://iam-service-net:8080
# - IamService__ServiceName=storage-service
# ports:
# - "5002:8080"
# depends_on:
# minio:
# condition: service_healthy
# traefik:
# condition: service_started
# networks:
# - microservices-network
# restart: unless-stopped
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8080/health/live"]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 40s
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.storage-service.rule=PathPrefix(`/api/v1/files`) || PathPrefix(`/api/v1/quota`)"
# - "traefik.http.routers.storage-service.entrypoints=web"
# - "traefik.http.services.storage-service.loadbalancer.server.port=8080"
# - "traefik.http.services.storage-service.loadbalancer.healthcheck.path=/health/live"
# - "traefik.http.services.storage-service.loadbalancer.healthcheck.interval=10s"
# Storage Service .NET - File Storage Management
storage-service:
build:
context: ../../services/storage-service-net
dockerfile: Dockerfile
image: goodgo/storage-service-net:latest
container_name: storage-service-local
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:8080
# EN: Database - Neon PostgreSQL
# VI: Cơ sở dữ liệu - Neon PostgreSQL
- ConnectionStrings__DefaultConnection=Host=ep-holy-glitter-a4hongg7-pooler.us-east-1.aws.neon.tech;Port=5432;Database=storage_service;Username=neondb_owner;Password=npg_Ssfy6HKO0cXI;SSL Mode=Require
# EN: Storage - External MinIO
# VI: Storage - MinIO bên ngoài
- Storage__Provider=minio
- Storage__DefaultBucket=goodgo
- Storage__MinIO__Endpoint=167.114.174.113:9000
- Storage__MinIO__AccessKey=minioadmin
- Storage__MinIO__SecretKey=Velik@2026
- Storage__MinIO__UseSSL=false
# EN: IAM Service Communication
# VI: Giao tiếp IAM Service
- IamService__BaseUrl=http://iam-service-net:8080
- IamService__ServiceName=storage-service
# EN: Redis Cache
# VI: Cache Redis
- Redis__Host=167.114.174.113
- Redis__Port=6379
- Redis__Password=Velik@2026
ports:
- "5002:8080"
depends_on:
iam-service-net:
condition: service_healthy
traefik:
condition: service_started
networks:
- microservices-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health/live"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "traefik.enable=true"
- "traefik.http.routers.storage-service.rule=PathPrefix(`/api/v1/files`) || PathPrefix(`/api/v1/quota`)"
- "traefik.http.routers.storage-service.entrypoints=web"
- "traefik.http.services.storage-service.loadbalancer.server.port=8080"
- "traefik.http.services.storage-service.loadbalancer.healthcheck.path=/health/live"
- "traefik.http.services.storage-service.loadbalancer.healthcheck.interval=10s"
# Social Service .NET - Social Graph Management