-
Notifications
You must be signed in to change notification settings - Fork 9
/
compose.yaml
93 lines (88 loc) · 2.88 KB
/
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
services:
# This is Swetrix user interface application, it's used to display the analytics data, render charts, etc.
swetrix:
image: swetrix/swetrix-fe:v3.3.0
restart: always
depends_on:
- swetrix-api
ports:
- '80:3000'
environment:
- API_URL=${API_URL}
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/ping || exit 1"]
interval: 30s
start_period: 15s
# This is Swetrix API, it's purpose is to collect incoming analytical events and serve the data to the UI
swetrix-api:
image: swetrix/swetrix-api:v3.3.0
restart: always
container_name: swetrix-api
ports:
- '8080:5005'
environment:
# Configurable with .env file
- JWT_ACCESS_TOKEN_SECRET=${JWT_ACCESS_TOKEN_SECRET}
- JWT_REFRESH_TOKEN_SECRET=${JWT_REFRESH_TOKEN_SECRET}
- EMAIL=${EMAIL}
- PASSWORD=${PASSWORD}
- API_KEY=${API_KEY}
- IP_GEOLOCATION_DB_PATH=${IP_GEOLOCATION_DB_PATH}
- DEBUG_MODE=${DEBUG_MODE}
- CLOUDFLARE_PROXY_ENABLED=${CLOUDFLARE_PROXY_ENABLED}
# Redis and Clickhouse are required for the API to work
- REDIS_HOST=redis
- CLICKHOUSE_HOST=http://clickhouse
links:
- 'redis'
- 'clickhouse'
depends_on:
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5005/ping || exit 1"]
interval: 30s
start_period: 15s
redis:
image: redis:7.2-alpine
restart: always
environment:
- REDIS_PORT=6379
- REDIS_USER=default
- REDIS_PASSWORD=${REDIS_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 30s
start_period: 1m
clickhouse:
image: clickhouse/clickhouse-server:24.10-alpine
container_name: clickhouse
environment:
- CLICKHOUSE_DATABASE=analytics
- CLICKHOUSE_USER=default
- CLICKHOUSE_PORT=8123
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"]
interval: 30s
start_period: 1m
restart: always
cap_add:
- SYS_NICE
volumes:
- swetrix-events-data:/var/lib/clickhouse
# Disable logging
- ./clickhouse/reduce-logs.xml:/etc/clickhouse-server/config.d/reduce-logs.xml:ro
- ./clickhouse/disable-user-logging.xml:/etc/clickhouse-server/users.d/disable-user-logging.xml:ro
# Reduce RAM usage
- ./clickhouse/preserve-ram-config.xml:/etc/clickhouse-server/config.d/preserve-ram-config.xml:ro
- ./clickhouse/preserve-ram-user.xml:/etc/clickhouse-server/users.d/preserve-ram-user.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
swetrix-events-data:
driver: local