-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.preview.yml
More file actions
92 lines (87 loc) · 2.88 KB
/
docker-compose.preview.yml
File metadata and controls
92 lines (87 loc) · 2.88 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
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: sidmonitor
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: sidmonitor
volumes:
- postgres_preview:/var/lib/postgresql/data
networks:
- coolify
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sidmonitor -d sidmonitor"]
interval: 10s
timeout: 5s
retries: 5
clickhouse:
image: clickhouse/clickhouse-server:24.8
environment:
CLICKHOUSE_DB: sid_monitoring
CLICKHOUSE_USER: default
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
volumes:
- clickhouse_preview:/var/lib/clickhouse
- ./clickhouse/init:/docker-entrypoint-initdb.d
networks:
- coolify
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8123/ping"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
clickhouse:
condition: service_healthy
environment:
HOST: 0.0.0.0
PORT: 8000
DEBUG: "false"
DATABASE_URL: postgresql+asyncpg://sidmonitor:${POSTGRES_PASSWORD:-password}@postgres:5432/sidmonitor
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_DATABASE: sid_monitoring
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
JWT_SECRET_KEY: ${JWT_SECRET_KEY:-change-this-in-production}
CORS_ORIGINS: "https://${PREVIEW_SLUG:-preview}.${BASE_DOMAIN:-preview.musetools.com}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}-api.rule=Host(`${PREVIEW_SLUG:-preview}-api.${BASE_DOMAIN:-preview.musetools.com}`)"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}-api.entrypoints=https"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}-api.tls=true"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}-api.tls.certresolver=letsencrypt"
- "traefik.http.services.${PREVIEW_SLUG:-preview}-api.loadbalancer.server.port=8000"
networks:
- coolify
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.preview
args:
VITE_API_URL: ""
depends_on:
- backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}.rule=Host(`${PREVIEW_SLUG:-preview}.${BASE_DOMAIN:-preview.musetools.com}`)"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}.entrypoints=https"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}.tls=true"
- "traefik.http.routers.${PREVIEW_SLUG:-preview}.tls.certresolver=letsencrypt"
- "traefik.http.services.${PREVIEW_SLUG:-preview}.loadbalancer.server.port=80"
networks:
- coolify
restart: unless-stopped
volumes:
postgres_preview:
clickhouse_preview:
networks:
coolify:
external: true