forked from Dushyant-rahangdale/OpsKnight
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 2.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (73 loc) · 2.86 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
services:
opsknight-db:
image: postgres:15-alpine
container_name: opsknight_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-opsknight}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-opsknight_secure_password_change_me}
POSTGRES_DB: ${POSTGRES_DB:-opsknight_db}
# PostgreSQL production optimizations
POSTGRES_INITDB_ARGS: '-E UTF8 --locale=C'
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- '${POSTGRES_PORT:-5432}:5432'
volumes:
- opsknight_postgres_data:/var/lib/postgresql/data
healthcheck:
test:
['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-opsknight} -d ${POSTGRES_DB:-opsknight_db}']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- opsknight-network
opsknight-app:
# Use the pre-built image from GitHub Container Registry (Test Channel)
# This avoids building from source locally and speeds up startup.
image: ghcr.io/dushyant-rahangdale/opsknight:latest
container_name: opsknight_app
pull_policy: always
restart: unless-stopped
ports:
- '${APP_PORT:-3000}:3000'
environment:
- NODE_ENV=production
# Database connection pool settings for scale (40 connections, 30s timeout)
# See coreconcepts/SCALABILITY.md for capacity details
- DATABASE_URL=postgresql://${POSTGRES_USER:-opsknight}:${POSTGRES_PASSWORD:-opsknight_secure_password_change_me}@opsknight-db:5432/${POSTGRES_DB:-opsknight_db}?sslmode=prefer&connection_limit=40&pool_timeout=30
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-change_this_to_a_random_secret_in_production}
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08}
- PORT=3000
- HOSTNAME=0.0.0.0
# Security headers
- NEXT_TELEMETRY_DISABLED=1
# NOTE: Notification providers (Twilio, Email, Push) are configured via UI
# Environment variables are NOT used - configure at Settings → System → Notification Providers
depends_on:
opsknight-db:
condition: service_healthy
healthcheck:
test:
[
'CMD-SHELL',
'node -e "require(''http'').get(''http://localhost:3000/api/health'', (r) => {let data='''';r.on(''data'',(c)=>data+=c);r.on(''end'',()=>{try{const res=JSON.parse(data);process.exit(res.status===''healthy''?0:1)}catch(e){process.exit(1)}});}).on(''error'',()=>process.exit(1))"',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- opsknight-network
command: >
sh -c "./docker-entrypoint.sh"
volumes:
opsknight_postgres_data:
networks:
opsknight-network:
driver: bridge
driver_opts:
com.docker.network.bridge.name: opsknight-br0
com.docker.network.driver.mtu: 1500