-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathdocker-compose.coolify.yml
More file actions
95 lines (90 loc) · 3.22 KB
/
docker-compose.coolify.yml
File metadata and controls
95 lines (90 loc) · 3.22 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
# ═══════════════════════════════════════════════════════════════════════════════
# XActions — Docker Compose for Coolify / Self-Hosting
# Production-ready with Traefik labels for reverse proxy
# Deploy: paste docker-compose.coolify.yml into Coolify dashboard
# by nichxbt
# ═══════════════════════════════════════════════════════════════════════════════
services:
api:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.xactions.rule=Host(`${DOMAIN:-xactions.localhost}`)"
- "traefik.http.routers.xactions.entrypoints=websecure"
- "traefik.http.routers.xactions.tls.certresolver=letsencrypt"
- "traefik.http.services.xactions.loadbalancer.server.port=3001"
environment:
NODE_ENV: production
PORT: 3001
DATABASE_URL: postgresql://xactions:${POSTGRES_PASSWORD:-changeme}@postgres:5432/xactions?schema=public
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET}
SESSION_SECRET: ${SESSION_SECRET:-changeme}
PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium
PUPPETEER_HEADLESS: "true"
PUPPETEER_NO_SANDBOX: "true"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: >
sh -c "npx prisma migrate deploy && node api/server.js"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/api/health"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
worker:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
NODE_ENV: production
DATABASE_URL: postgresql://xactions:${POSTGRES_PASSWORD:-changeme}@postgres:5432/xactions?schema=public
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET}
PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium
PUPPETEER_HEADLESS: "true"
PUPPETEER_NO_SANDBOX: "true"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: ["node", "api/services/jobQueue.js"]
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: xactions
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: xactions
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U xactions"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 128mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
redis_data: