CoolFace
Apppublic

OnyxMunk/AudioForge

sourceHugging Facemitupdated 8mo agoView on Hugging Face
0likes
docker-compose.demo.yml191 linesDownload Raw Back to root
1# ============================================
2# AudioForge - Demo Configuration
3# ============================================
4# Uses alternative ports to avoid conflicts
5# Perfect for presentations and demos
6
7version: '3.8'
8
9services:
10  # ============================================
11  # Database Layer
12  # ============================================
13  postgres:
14    image: postgres:16-alpine
15    container_name: audioforge-postgres
16    restart: unless-stopped
17    environment:
18      POSTGRES_USER: postgres
19      POSTGRES_PASSWORD: postgres
20      POSTGRES_DB: audioforge
21      POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.utf8"
22      PGDATA: /var/lib/postgresql/data/pgdata
23    ports:
24      - "5433:5432"
25    volumes:
26      - postgres_data:/var/lib/postgresql/data
27    healthcheck:
28      test: ["CMD-SHELL", "pg_isready -U postgres -d audioforge"]
29      interval: 10s
30      timeout: 5s
31      retries: 5
32      start_period: 10s
33    networks:
34      - audioforge-network
35    labels:
36      com.audioforge.service: "database"
37      com.audioforge.description: "PostgreSQL Database"
38
39  # ============================================
40  # Cache Layer
41  # ============================================
42  redis:
43    image: redis:7-alpine
44    container_name: audioforge-redis
45    restart: unless-stopped
46    command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
47    ports:
48      - "6380:6379"
49    volumes:
50      - redis_data:/data
51    healthcheck:
52      test: ["CMD", "redis-cli", "ping"]
53      interval: 10s
54      timeout: 5s
55      retries: 5
56      start_period: 5s
57    networks:
58      - audioforge-network
59    labels:
60      com.audioforge.service: "cache"
61      com.audioforge.description: "Redis Cache"
62
63  # ============================================
64  # Backend API
65  # ============================================
66  backend:
67    build:
68      context: ./backend
69      dockerfile: Dockerfile
70      target: runtime
71    container_name: audioforge-backend
72    restart: unless-stopped
73    ports:
74      - "8001:8000"
75    environment:
76      # Database
77      DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/audioforge
78      # Cache
79      REDIS_URL: redis://redis:6379/0
80      # ML Settings
81      MUSICGEN_DEVICE: cpu
82      BARK_DEVICE: cpu
83      # Application
84      LOG_LEVEL: info
85      ENVIRONMENT: production
86      # Security
87      ALLOWED_ORIGINS: "http://localhost:3000,http://frontend:3000"
88    volumes:
89      - audio_storage:/app/storage
90      - model_cache:/root/.cache
91    depends_on:
92      postgres:
93        condition: service_healthy
94      redis:
95        condition: service_healthy
96    healthcheck:
97      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
98      interval: 30s
99      timeout: 10s
100      retries: 3
101      start_period: 40s
102    networks:
103      - audioforge-network
104    labels:
105      com.audioforge.service: "backend"
106      com.audioforge.description: "FastAPI Backend API"
107    deploy:
108      resources:
109        limits:
110          cpus: '2'
111          memory: 4G
112        reservations:
113          cpus: '1'
114          memory: 2G
115
116  # ============================================
117  # Frontend Application
118  # ============================================
119  frontend:
120    build:
121      context: ./frontend
122      dockerfile: Dockerfile
123      target: runner
124    container_name: audioforge-frontend
125    restart: unless-stopped
126    ports:
127      - "3000:3000"
128    environment:
129      NEXT_PUBLIC_API_URL: http://localhost:8001
130      NODE_ENV: production
131    depends_on:
132      backend:
133        condition: service_healthy
134    healthcheck:
135      test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
136      interval: 30s
137      timeout: 10s
138      retries: 3
139      start_period: 40s
140    networks:
141      - audioforge-network
142    labels:
143      com.audioforge.service: "frontend"
144      com.audioforge.description: "Next.js Frontend"
145    deploy:
146      resources:
147        limits:
148          cpus: '1'
149          memory: 1G
150        reservations:
151          cpus: '0.5'
152          memory: 512M
153
154# ============================================
155# Networks
156# ============================================
157networks:
158  audioforge-network:
159    driver: bridge
160    name: audioforge-network
161    labels:
162      com.audioforge.network: "main"
163
164# ============================================
165# Volumes
166# ============================================
167volumes:
168  postgres_data:
169    driver: local
170    name: audioforge-postgres-data
171    labels:
172      com.audioforge.volume: "database"
173  
174  redis_data:
175    driver: local
176    name: audioforge-redis-data
177    labels:
178      com.audioforge.volume: "cache"
179  
180  audio_storage:
181    driver: local
182    name: audioforge-audio-storage
183    labels:
184      com.audioforge.volume: "audio"
185  
186  model_cache:
187    driver: local
188    name: audioforge-model-cache
189    labels:
190      com.audioforge.volume: "models"
191