forked from Openpanel-dev/openpanel
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
156 lines (146 loc) · 3.58 KB
/
docker-compose.yml
File metadata and controls
156 lines (146 loc) · 3.58 KB
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
version: '3'
services:
op-db:
image: postgres:14-alpine
restart: always
volumes:
- op-db-data:/var/lib/postgresql/data
healthcheck:
test:
- CMD-SHELL
- pg_isready -U postgres
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
expose:
- 5432
networks:
- dokploy-network
op-kv:
image: redis:7.2.5-alpine
restart: always
volumes:
- op-kv-data:/data
command:
- redis-server
- '--maxmemory-policy'
- noeviction
expose:
- 6379
networks:
- dokploy-network
op-geo:
image: observabilitystack/geoip-api:latest
restart: always
expose:
- 8080
networks:
- dokploy-network
op-ch:
image: clickhouse/clickhouse-server:24.3.2-alpine
restart: always
volumes:
- op-ch-data:/var/lib/clickhouse
- op-ch-logs:/var/log/clickhouse-server
- ./self-hosting/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/op-config.xml:ro
- ./self-hosting/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/op-user-config.xml:ro
- ./self-hosting/clickhouse/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
healthcheck:
test:
- CMD-SHELL
- clickhouse-client --query "SELECT 1"
interval: 10s
timeout: 5s
retries: 5
ulimits:
nofile:
soft: 262144
hard: 262144
expose:
- 8123
- 9000
- 9009
networks:
- dokploy-network
command: >
sh -c "
/entrypoint.sh &
until clickhouse-client --query 'SELECT 1' >/dev/null 2>&1; do
echo 'Waiting for ClickHouse to start...'
sleep 1
done
echo 'Running init-db.sh...'
bash /docker-entrypoint-initdb.d/init-db.sh
wait
"
op-api:
image: lindesvard/openpanel-api:latest
restart: always
command: |
sh -c "
echo 'Waiting for PostgreSQL to be ready...'
while ! nc -z op-db 5432; do
sleep 1
done
echo 'PostgreSQL is ready'
echo 'Waiting for ClickHouse to be ready...'
while ! nc -z op-ch 8123; do
sleep 1
done
echo 'ClickHouse is ready'
echo 'Running migrations...'
CI=true pnpm -r run migrate:deploy
pnpm start
"
depends_on:
- op-db
- op-ch
- op-kv
- op-geo
env_file:
- .env
expose:
- 3000
labels:
- traefik.http.routers.infra-openpanel-adz5pb-9-web.middlewares=strip-api-prefix,redirect-to-https@file
- traefik.http.routers.infra-openpanel-adz5pb-9-websecure.middlewares=strip-api-prefix
- traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api
op-dashboard:
image: lindesvard/openpanel-dashboard:latest
restart: always
depends_on:
- op-api
env_file:
- .env
expose:
- 3000
op-worker:
image: lindesvard/openpanel-worker:latest
restart: always
depends_on:
- op-api
env_file:
- .env
deploy:
mode: replicated
replicas: 4
expose:
- 3000
labels:
- "traefik.http.routers.infra-openpanel-adz5pb-11-web.middlewares=redirect-to-https@file,worker-basic-auth@file"
- "traefik.http.routers.infra-openpanel-adz5pb-11-websecure.middlewares=worker-basic-auth@file"
volumes:
op-db-data:
driver: local
op-kv-data:
driver: local
op-ch-data:
driver: local
op-ch-logs:
driver: local
networks:
dokploy-network:
external: true