-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocker-compose.yml
212 lines (201 loc) · 6.07 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
version: '3.8'
x-all: &all
LIBRARY_PATH: ${LIBRARY_PATH:-/home/nendo/nendo_library}
LIBRARY_PLUGIN: ${LIBRARY_PLUGIN:-nendo_plugin_library_postgres}
PLUGINS: '${PLUGINS-[]}'
ENVIRONMENT: ${ENVIRONMENT:-remote}
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME:-nendo-internal}
NUM_USER_CPU_WORKERS: ${NUM_USER_CPU_WORKERS-3}
NUM_GPU_WORKERS: ${NUM_GPU_WORKERS-1}
CHUNK_ACTIONS: ${CHUNK_ACTIONS-false}
DEFAULT_ACTION_TIMEOUT: ${DEFAULT_ACTION_TIMEOUT--1}
DEFAULT_TRACK_PROCESSING_TIMEOUT: ${DEFAULT_TRACK_PROCESSING_TIMEOUT-600}
GOOGLE_STORAGE_CREDENTIALS: "${NUM_GPU_WORKERS-}"
SECRET: "${SECRET-}"
CLIENT_ID: "${CLIENT_ID-}"
CLIENT_SECRET: "${CLIENT_SECRET-}"
AUTH_DATABASE_CONNECTION: "${AUTH_DATABASE_CONNECTION:-postgresql+asyncpg://nendo:nendo@postgres:5432/auth}"
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-nendo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nendo}
POSTGRES_DB: ${POSTGRES_DB:-nendo}
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT-6379}
REDIS_DB: ${REDIS_DB-0}
REDIS_USER: ${REDIS_USER-}
REDIS_PASSWORD: ${REDIS_PASSWORD-}
CONTAINER_LIBRARY_PLUGIN: ${CONTAINER_LIBRARY_PLUGIN:-nendo_plugin_library_postgres}
CONTAINER_LIBRARY_PATH: ${CONTAINER_LIBRARY_PATH:-/home/nendo/nendo_library}
CONTAINER_HOST_BASE_PATH: ${HOST_CWD:?HOST_CWD must be set to contain the current path}
CONTAINER_HOST_APPS_PATH: ${HOST_CWD}/repo/nendo-server/nendo_server/apps
CONTAINER_POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
CONTAINER_POSTGRES_USER: ${POSTGRES_USER:-nendo}
CONTAINER_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nendo}
CONTAINER_POSTGRES_DB: ${POSTGRES_DB:-nendo}
AUTO_RESAMPLE: ${AUTO_RESAMPLE-false}
DEFAULT_SR: ${DEFAULT_SR-44100}
AUTO_CONVERT: ${AUTO_CONVERT-true}
SKIP_DUPLICATE: ${SKIP_DUPLICATE-true}
REPLACE_PLUGIN_DATA: ${REPLACE_PLUGIN_DATA-false}
x-dev: &dev
LOG_LEVEL: debug
CONTAINER_LOG_LEVEL: debug
# REDIRECT_URL: "${SERVER_URL}/callback"
USE_GPU: ${USE_GPU-true}
USER_STORAGE_SIZE: ${USER_STORAGE_SIZE--1}
x-prod: &prod
LOG_LEVEL: warning
CONTAINER_LOG_LEVEL: warning
# REDIRECT_URL: "${SERVER_URL}/callback"
USE_GPU: ${USE_GPU-true}
EMAIL_FROM_ADDRESS: ${MAILGUN_FROM_ADDRESS:[email protected]}
MAILGUN_API_KEY: ${MAILGUN_API_KEY:-REPLACE_KEY}
EMAIL_VERIFY_URL_INTERNAL: "nendo-server/api/auth/verify"
EMAIL_VERIFY_URL_PUBLIC_UI: "${SERVER_URL:-http://localhost}/verified"
PASSWORD_RESET_URL_PUBLIC: "${SERVER_URL:-http://localhost}/setpassword"
USER_STORAGE_SIZE: ${USER_STORAGE_SIZE--1}
services:
gateway:
image: nginx:latest
container_name: nendo-gateway
ports:
- "80:80"
volumes:
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
internal:
ipv4_address: 172.28.1.2
depends_on:
- postgres
- web-dev
- server-dev
profiles: ['dev']
web:
build:
context: ./repo/nendo-web
target: run-stage
image: nendo-web:latest
container_name: nendo-web
environment:
VITE_API_URL: ${SERVER_URL:-http://localhost}
ports:
- "80:80"
- "443:443"
volumes:
- ./conf/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro
- ${SSL_CERTIFICATE_PATH:-./conf/nginx/certs/nendo.crt}:/etc/nginx/ssl/nendo.crt:ro
- ${SSL_KEY_PATH:-./conf/nginx/certs/nendo.key}:/etc/nginx/ssl/nendo.key:ro
networks:
internal:
ipv4_address: 172.28.1.3
profiles: ['prod']
web-http:
build:
context: ./repo/nendo-web
target: run-stage
image: nendo-web:latest
container_name: nendo-web
environment:
VITE_API_URL: ${SERVER_URL:-http://localhost}
ports:
- "80:80"
volumes:
- ./conf/nginx/nginx.http-only.conf:/etc/nginx/nginx.conf:ro
networks:
internal:
ipv4_address: 172.28.1.3
profiles: ['prod-http']
server:
build:
context: ./repo/nendo-server
target: nendo-server-prod
image: nendo-server:latest
container_name: nendo-server
environment:
<< : [*all, *prod]
volumes:
- ./library:/home/nendo/nendo_library
- /var/run/docker.sock:/var/run/docker.sock
- models-cache:/home/nendo/.cache
depends_on:
- postgres
- redis
networks:
internal:
ipv4_address: 172.28.1.4
profiles: ['prod', 'prod-http']
web-dev:
build:
context: ./repo/nendo-web
target: dev-stage
image: nendo-web:latest
container_name: nendo-web
environment:
VITE_API_URL: ${SERVER_URL:-http://localhost}
ports:
- 5173:5173
volumes:
- ./repo/nendo-web/src:/app/src
- ./repo/nendo-web/public:/app/public
networks:
internal:
ipv4_address: 172.28.1.3
profiles: ['dev']
server-dev:
build:
context: ./repo/nendo-server
target: nendo-server-dev
image: nendo-server:latest
container_name: nendo-server
ports:
- "8000:8000"
environment:
<< : [*all, *dev]
volumes:
- ./repo/nendo-server/nendo_server:/home/nendo/nendo-server/nendo_server
- ./library:/home/nendo/nendo_library
- /var/run/docker.sock:/var/run/docker.sock
- models-cache:/home/nendo/.cache
depends_on:
- postgres
- redis
networks:
internal:
ipv4_address: 172.28.1.4
profiles: ['dev']
postgres:
image: ankane/pgvector
container_name: nendo-postgres
hostname: postgres
environment:
POSTGRES_USER: nendo
POSTGRES_PASSWORD: nendo
POSTGRES_DB: nendo
volumes:
- postgres-data:/var/lib/postgresql/data
- ./conf/postgres/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
networks:
internal:
ipv4_address: 172.28.1.5
redis:
image: redis:latest
hostname: redis
container_name: nendo-redis
# environment:
# REDIS_PASSWORD: nendo
# volumes:
# - redis-data:/data
networks:
internal:
ipv4_address: 172.28.1.6
networks:
internal:
name: ${DOCKER_NETWORK_NAME:-nendo-internal}
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
volumes:
postgres-data:
models-cache:
redis-data: