Initial commit: HelpDesk ICHN - .NET 10 backend + Next.js 16 frontend
This commit is contained in:
commit
359f0caf85
90 files changed
+13395
No files matched your search
@@ -0,0 +1,126 @@
|
||||
# ============================================================
|
||||
# HelpDesk ICHN - Docker Compose Principal
|
||||
# Caddy + Backend .NET 10 + Frontend Next.js 15 + PG + Redis
|
||||
# ============================================================
|
||||
|
||||
networks:
|
||||
helpdesk-net:
|
||||
name: helpdesk-net
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
pgdata-helpdesk:
|
||||
redis-data:
|
||||
caddy-data:
|
||||
caddy-config:
|
||||
|
||||
services:
|
||||
# =============================================
|
||||
# GATEWAY - Caddy Reverse Proxy
|
||||
# =============================================
|
||||
caddy:
|
||||
image: caddy:2-alpine
|
||||
container_name: helpdesk-caddy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "8443:443"
|
||||
volumes:
|
||||
- ./gateway/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- ./gateway/certs:/certs:ro
|
||||
- caddy-data:/data
|
||||
- caddy-config:/config
|
||||
networks:
|
||||
- helpdesk-net
|
||||
|
||||
# =============================================
|
||||
# BACKEND - .NET 10 (HelpDesk.API)
|
||||
# =============================================
|
||||
api:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: helpdesk-api
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
ASPNETCORE_URLS: http://+:5000
|
||||
DB_CONNECTION: Host=helpdesk-postgres;Database=helpdesk;Username=helpdesk;Password=${PG_PASSWORD:-helpdesk_pass}
|
||||
JWT_SECRET: ${JWT_SECRET:-your-super-secret-key-change-in-production-2024}
|
||||
JWT_ISSUER: HelpDeskICHH
|
||||
JWT_AUDIENCE: HelpDeskICHH
|
||||
JWT_EXPIRY_MINUTES: "480"
|
||||
FrontendUrl: http://localhost:3000
|
||||
networks:
|
||||
- helpdesk-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pgrep -x dotnet || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
# =============================================
|
||||
# FRONTEND - Next.js 15
|
||||
# =============================================
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: helpdesk-frontend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
NEXT_PUBLIC_API_URL: http://localhost:5000
|
||||
networks:
|
||||
- helpdesk-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
# =============================================
|
||||
# DATABASE - PostgreSQL 16
|
||||
# =============================================
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: helpdesk-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: helpdesk
|
||||
POSTGRES_USER: helpdesk
|
||||
POSTGRES_PASSWORD: ${PG_PASSWORD:-helpdesk_pass}
|
||||
volumes:
|
||||
- pgdata-helpdesk:/var/lib/postgresql/data
|
||||
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
|
||||
ports:
|
||||
- "5433:5432"
|
||||
networks:
|
||||
- helpdesk-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U helpdesk -d helpdesk"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# =============================================
|
||||
# CACHE - Redis 7
|
||||
# =============================================
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: helpdesk-redis
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
ports:
|
||||
- "6381:6379"
|
||||
networks:
|
||||
- helpdesk-net
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
Reference in new issue
Block a user