CineMax commited on
Commit
7a4e1c5
Β·
verified Β·
1 Parent(s): 2b1236f

Upload docker-compose.yml

Browse files
Files changed (1) hide show
  1. docker-compose.yml +236 -0
docker-compose.yml ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # =============================================
2
+ # STREAMCORE DOCKER COMPOSE
3
+ # =============================================
4
+ #
5
+ # DEPLOYMENT OPTIONS:
6
+ #
7
+ # β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
8
+ # β”‚ OPTION 1: Development / Local Testing (NO SSL, NO NGINX) β”‚
9
+ # β”‚ β”‚
10
+ # β”‚ docker compose up -d --build β”‚
11
+ # β”‚ β”‚
12
+ # β”‚ Access: β”‚
13
+ # β”‚ - Frontend: http://localhost:5000 β”‚
14
+ # β”‚ - Backend: http://localhost:3000 β”‚
15
+ # β”‚ - Database: localhost:5433 (mapped to container 5432) β”‚
16
+ # β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
17
+ #
18
+ # β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
19
+ # β”‚ OPTION 2: Production with SSL (NGINX + Let's Encrypt) β”‚
20
+ # β”‚ β”‚
21
+ # β”‚ 1. Set your domains: β”‚
22
+ # β”‚ export FRONTEND_DOMAIN=yourdomain.com β”‚
23
+ # β”‚ export BACKEND_DOMAIN=api.yourdomain.com β”‚
24
+ # β”‚ export LETSENCRYPT_EMAIL=admin@yourdomain.com β”‚
25
+ # β”‚ β”‚
26
+ # β”‚ 2. Update PUBLIC_BASE_URL and NEXT_PUBLIC_API_URL below β”‚
27
+ # β”‚ β”‚
28
+ # β”‚ 3. Run with proxy profile: β”‚
29
+ # β”‚ docker compose --profile proxy up -d --build β”‚
30
+ # β”‚ β”‚
31
+ # β”‚ Access: β”‚
32
+ # β”‚ - Frontend: https://yourdomain.com β”‚
33
+ # β”‚ - Backend: https://api.yourdomain.com β”‚
34
+ # β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
35
+ #
36
+ # β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
37
+ # β”‚ OPTION 3: Your Own Reverse Proxy (Nginx, Traefik, Caddy, etc.) β”‚
38
+ # β”‚ β”‚
39
+ # β”‚ docker compose up -d --build β”‚
40
+ # β”‚ β”‚
41
+ # β”‚ Then configure your own proxy to forward: β”‚
42
+ # β”‚ - yourdomain.com -> localhost:5000 β”‚
43
+ # β”‚ - api.yourdomain.com -> localhost:3000 β”‚
44
+ # β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
45
+ #
46
+ # NOTE: The nginx-proxy services are ONLY started when you use --profile proxy.
47
+ # You don't need to delete or comment anything for Options 1 or 3.
48
+ #
49
+ # CONFIGURATION: Edit the values marked with βš™οΈ EDIT below
50
+ #
51
+ # =============================================
52
+
53
+ services:
54
+ # =============================================
55
+ # POSTGRESQL DATABASE
56
+ # =============================================
57
+ postgres:
58
+ image: postgres:16
59
+ container_name: streamcore-postgres
60
+ restart: unless-stopped
61
+ environment:
62
+ # βš™οΈ EDIT: Database credentials
63
+ POSTGRES_USER: streamcore
64
+ POSTGRES_PASSWORD: StreamCore_DB_2024_Production!
65
+ POSTGRES_DB: streamcore
66
+ volumes:
67
+ - postgres-data:/var/lib/postgresql/data
68
+ ports:
69
+ - "5433:5432"
70
+ networks:
71
+ - streamcore-network
72
+ healthcheck:
73
+ test: [ "CMD-SHELL", "pg_isready -U streamcore -d streamcore" ]
74
+ interval: 5s
75
+ timeout: 5s
76
+ retries: 10
77
+ start_period: 10s
78
+
79
+ # =============================================
80
+ # BACKEND API (Rust/Axum)
81
+ # =============================================
82
+ backend:
83
+ build:
84
+ context: ./backend
85
+ container_name: streamcore-backend
86
+ restart: unless-stopped
87
+ environment:
88
+ # Server
89
+ SERVER_ADDRESS: "0.0.0.0:3000"
90
+
91
+ # βš™οΈ EDIT: Must match postgres credentials above
92
+ DATABASE_URL: "postgres://streamcore:StreamCore_DB_2024_Production!@postgres:5432/streamcore"
93
+
94
+ # βš™οΈ EDIT: URLs (change to your domains for production)
95
+ PUBLIC_BASE_URL: "https://apistreamcore.syruum.com"
96
+ CORS_ALLOWED_ORIGINS: "https://streamcore.syruum.com,https://apistreamcore.syruum.com,http://localhost:5000,http://localhost:3000"
97
+
98
+ # βš™οΈ EDIT: Security - CHANGE THESE IN PRODUCTION!
99
+ JWT_SECRET: "${JWT_SECRET:-ae85a308c80be3b2006da9126620c5fbc2ceadeadbe9c8e9040e9ad0c5d362c8}"
100
+ ADMIN_DEFAULT_PASSWORD: "${ADMIN_DEFAULT_PASSWORD:-22333265}"
101
+
102
+ # βš™οΈ EDIT: Stripe (optional - for reseller payments)
103
+ STRIPE_SECRET_KEY: "sk_test_placeholder"
104
+ STRIPE_WEBHOOK_SECRET: "whsec_placeholder"
105
+ STRIPE_CURRENCY: "usd"
106
+ STRIPE_SUCCESS_URL: "https://streamcore.syruum.com/credits/success"
107
+ STRIPE_CANCEL_URL: "https://streamcore.syruum.com/credits/cancel"
108
+
109
+ # Backup Configuration
110
+ BACKUP_ENABLED: "true"
111
+ BACKUP_DIR: "/data/backups"
112
+ BACKUP_RETENTION_DAYS: "30"
113
+ BACKUP_INTERVAL_HOURS: "24"
114
+
115
+ # App Config
116
+ CONTENT_OVERVIEW_MULTIPLIER: "x1"
117
+ SKIP_MIGRATIONS: "false"
118
+ RUST_LOG: "iptv_backend=info,tower_http=warn,sqlx=warn"
119
+ DEBUG_MODE: "false"
120
+
121
+ # Nginx Proxy config (used when profile=proxy)
122
+ # βš™οΈ EDIT: Change to your backend domain
123
+ VIRTUAL_HOST: "apistreamcore.syruum.com"
124
+ VIRTUAL_PORT: "3000"
125
+ LETSENCRYPT_HOST: "apistreamcore.syruum.com"
126
+ LETSENCRYPT_EMAIL: "admin@syruum.com"
127
+ volumes:
128
+ - backend-data:/data
129
+ - /media:/media
130
+ ports:
131
+ - "3000:3000"
132
+ networks:
133
+ - streamcore-network
134
+ depends_on:
135
+ postgres:
136
+ condition: service_healthy
137
+
138
+ # =============================================
139
+ # FRONTEND WEB APP (Next.js)
140
+ # =============================================
141
+ frontend:
142
+ build:
143
+ context: ./frontend
144
+ args:
145
+ # βš™οΈ EDIT: Your app name
146
+ APP_NAME: "StreamCore"
147
+ # βš™οΈ EDIT: CRITICAL - Must be set at build time for client-side code
148
+ NEXT_PUBLIC_API_URL: "https://apistreamcore.syruum.com"
149
+ container_name: streamcore-frontend
150
+ restart: unless-stopped
151
+ environment:
152
+ # API URLs
153
+ INTERNAL_API_URL: "http://backend:3000"
154
+ # βš™οΈ EDIT: Change to your backend domain for production
155
+ NEXT_PUBLIC_API_URL: "https://apistreamcore.syruum.com"
156
+ NEXT_PUBLIC_APP_NAME: "StreamCore"
157
+
158
+ # Proxy settings
159
+ STREAMCORE_PROXY_ALLOWED_HOSTS: "*"
160
+ STREAMCORE_PROXY_REQUIRE_AUTH: "false"
161
+ STREAMCORE_PROXY_ALLOW_PRIVATE: "true"
162
+
163
+ # Nginx Proxy config (used when profile=proxy)
164
+ # βš™οΈ EDIT: Change to your frontend domain
165
+ VIRTUAL_HOST: "streamcore.syruum.com"
166
+ VIRTUAL_PORT: "5000"
167
+ LETSENCRYPT_HOST: "streamcore.syruum.com"
168
+ LETSENCRYPT_EMAIL: "admin@syruum.com"
169
+ depends_on:
170
+ - backend
171
+ ports:
172
+ - "5000:5000"
173
+ networks:
174
+ - streamcore-network
175
+
176
+ # =============================================
177
+ # NGINX REVERSE PROXY (Production with SSL)
178
+ # =============================================
179
+ # Automatically generates SSL certificates via Let's Encrypt
180
+ # Enable with: docker compose --profile proxy up -d --build
181
+ #
182
+ # Required environment variables (set in .env or export):
183
+ # FRONTEND_DOMAIN=yourdomain.com
184
+ # BACKEND_DOMAIN=api.yourdomain.com
185
+ # LETSENCRYPT_EMAIL=admin@yourdomain.com
186
+ #
187
+ nginx-proxy:
188
+ image: nginxproxy/nginx-proxy:1.4
189
+ container_name: nginx-proxy
190
+ restart: always
191
+ profiles:
192
+ - proxy
193
+ ports:
194
+ - "80:80"
195
+ - "443:443"
196
+ volumes:
197
+ - /var/run/docker.sock:/tmp/docker.sock:ro
198
+ - nginx-certs:/etc/nginx/certs:ro
199
+ - nginx-vhost:/etc/nginx/vhost.d
200
+ - nginx-html:/usr/share/nginx/html
201
+ - ./nginx/custom.conf:/etc/nginx/conf.d/custom.conf:ro
202
+ networks:
203
+ - streamcore-network
204
+
205
+ acme-companion:
206
+ image: nginxproxy/acme-companion:2.2
207
+ container_name: acme-companion
208
+ restart: always
209
+ profiles:
210
+ - proxy
211
+ volumes:
212
+ - /var/run/docker.sock:/var/run/docker.sock:ro
213
+ - nginx-certs:/etc/nginx/certs:rw
214
+ - nginx-vhost:/etc/nginx/vhost.d
215
+ - nginx-html:/usr/share/nginx/html
216
+ - acme-state:/etc/acme.sh
217
+ environment:
218
+ # βš™οΈ EDIT: Your email for Let's Encrypt notifications
219
+ DEFAULT_EMAIL: "admin@syruum.com"
220
+ NGINX_PROXY_CONTAINER: nginx-proxy
221
+ depends_on:
222
+ - nginx-proxy
223
+ networks:
224
+ - streamcore-network
225
+
226
+ networks:
227
+ streamcore-network:
228
+ driver: bridge
229
+
230
+ volumes:
231
+ backend-data:
232
+ postgres-data:
233
+ nginx-certs:
234
+ nginx-vhost:
235
+ nginx-html:
236
+ acme-state: