-
Notifications
You must be signed in to change notification settings - Fork 212
/
docker-compose.yaml
141 lines (134 loc) · 4 KB
/
docker-compose.yaml
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
services:
postgres:
image: postgres
environment:
POSTGRES_DB: 'briefer'
POSTGRES_USER: ${POSTGRES_USERNAME:?error}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?error}
healthcheck:
test:
[
'CMD-SHELL',
'pg_isready -U ${POSTGRES_USERNAME:?error} -d briefer || exit 1',
]
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql/data
db_migration:
image: briefercloud/briefer-api
build:
context: '.'
dockerfile: 'apps/api/Dockerfile'
working_dir: '/app/packages/database'
command: ['npx', 'prisma', 'migrate', 'deploy']
environment:
NODE_ENV: 'production'
POSTGRES_PRISMA_URL: 'postgresql://${POSTGRES_USERNAME:?error}:${POSTGRES_PASSWORD:?error}@postgres:5432/briefer?schema=public'
depends_on:
postgres:
condition: service_healthy
jupyter_server:
image: briefercloud/briefer-jupyter
labels:
'cloud.briefer.jupyter-container': 'true'
build:
context: 'apps/api'
dockerfile: 'jupyter.Dockerfile'
command:
- 'sh'
- '-c'
- 'jupyter server --ip=0.0.0.0 --ZMQChannelsWebsocketConnection.iopub_data_rate_limit=1.0e10 --ZMQChannelsWebsocketConnection.iopub_msg_rate_limit=1.0e6 --ServerApp.max_body_size=107374182400'
environment:
JUPYTER_TOKEN: ${JUPYTER_TOKEN:?error}
volumes:
- jupyter:/home/jupyteruser
restart: always
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:8888/api || exit 1']
interval: 5s
timeout: 10s
retries: 5
ai:
image: briefercloud/briefer-ai
build:
context: 'ai'
dockerfile: 'Dockerfile'
environment:
BASIC_AUTH_USERNAME: ${AI_BASIC_AUTH_USERNAME:?error}
BASIC_AUTH_PASSWORD: ${AI_BASIC_AUTH_PASSWORD:?error}
OPENAI_DEFAULT_MODEL_NAME: 'gpt-4o'
OPENAI_API_KEY: ${OPENAI_API_KEY:?error}
PORT: 8000
restart: always
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:8000/ping || exit 1']
interval: 5s
timeout: 10s
retries: 5
web:
image: briefercloud/briefer-web
build:
context: '.'
dockerfile: 'apps/web/Dockerfile'
environment:
NODE_ENV: 'production'
depends_on:
api:
condition: service_healthy
api:
image: briefercloud/briefer-api
build:
context: '.'
dockerfile: 'apps/api/Dockerfile'
environment:
NODE_ENV: 'production'
LOG_LEVEL: 'debug'
API_URL: '/api'
FRONTEND_URL: '/'
LOGIN_JWT_SECRET: ${LOGIN_JWT_SECRET:?error}
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET:?error}
AI_API_URL: 'http://ai:8000'
AI_API_USERNAME: ${AI_BASIC_AUTH_USERNAME:?error}
AI_API_PASSWORD: ${AI_BASIC_AUTH_PASSWORD:?error}
PYTHON_ALLOWED_LIBRARIES: 'plotly,matplotlib,numpy,pandas'
POSTGRES_USERNAME: ${POSTGRES_USERNAME:?error}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?error}
POSTGRES_HOSTNAME: 'postgres'
POSTGRES_PORT: '5432'
POSTGRES_DATABASE: 'briefer'
ENVIRONMENT_VARIABLES_ENCRYPTION_KEY: ${ENVIRONMENT_VARIABLES_ENCRYPTION_KEY:?error}
WORKSPACE_SECRETS_ENCRYPTION_KEY: ${WORKSPACE_SECRETS_ENCRYPTION_KEY:?error}
DATASOURCES_ENCRYPTION_KEY: ${DATASOURCES_ENCRYPTION_KEY:?error}
JUPYTER_HOST: 'jupyter_server'
JUPYTER_PORT: 8888
JUPYTER_TOKEN: ${JUPYTER_TOKEN:?error}
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:8080/readyz || exit 1']
interval: 5s
timeout: 10s
retries: 5
depends_on:
postgres:
condition: service_healthy
db_migration:
condition: service_completed_successfully
jupyter_server:
condition: service_healthy
restart: true
ai:
condition: service_healthy
nginx:
image: nginx:1.27
depends_on:
- web
- api
ports:
- '3000:3000'
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
restart: always
volumes:
jupyter:
postgres_data: