Repository navigation
Expand file tree
/
Copy pathdocker-compose.coolify.yml
More file actions
162 lines (132 loc) · 5.11 KB
/
Copy pathdocker-compose.coolify.yml
File metadata and controls
162 lines (132 loc) · 5.11 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
156
157
158
159
160
161
services:
directus:
build:
context: .
dockerfile: Dockerfile
target: api-production
args:
- TURBO_TOKEN=${TURBO_TOKEN}
environment:
# Coolify magic variables for FQDN and passwords
- SERVICE_FQDN_DIRECTUS
# Core Directus configuration
- KEY=${SERVICE_PASSWORD_64_KEY}
- SECRET=${SERVICE_PASSWORD_64_SECRET}
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@moca-codex.com}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
# Database configuration (PostgreSQL)
- DB_CLIENT=pg
- DB_HOST=postgres
- DB_PORT=5432
- DB_DATABASE=${POSTGRES_DB:-codex}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_SSL=false
- DB_SSL__REJECT_UNAUTHORIZED=${DB_SSL_REJECT_UNAUTHORIZED:-false}
# Cache configuration (Redis)
- CACHE_ENABLED=${CACHE_ENABLED:-true}
- CACHE_AUTO_PURGE=${CACHE_AUTO_PURGE:-true}
- CACHE_STORE=redis
# Redis connection (using connection string for reliable auth)
- REDIS=redis://:${SERVICE_PASSWORD_REDIS}@redis:6379
# Synchronization configuration (required for multi-container deployments)
- SYNCHRONIZATION_STORE=redis
- SYNCHRONIZATION_NAMESPACE=${SYNCHRONIZATION_NAMESPACE:-directus-sync}
# Storage configuration
- STORAGE_LOCATIONS=${STORAGE_LOCATIONS:-local}
- STORAGE_LOCAL_ROOT=${STORAGE_LOCAL_ROOT:-/directus/uploads}
# Application configuration
- PUBLIC_URL=https://${SERVICE_FQDN_DIRECTUS}
- WEBSOCKETS_ENABLED=${WEBSOCKETS_ENABLED:-true}
- WEBSOCKETS_HEARTBEAT_ENABLED=${WEBSOCKETS_HEARTBEAT_ENABLED:-true}
- EXTENSIONS_AUTO_RELOAD=${EXTENSIONS_AUTO_RELOAD:-false}
# Rate limiting
- RATE_LIMITER_ENABLED=${RATE_LIMITER_ENABLED:-true}
- RATE_LIMITER_POINTS=${RATE_LIMITER_POINTS:-50}
- RATE_LIMITER_DURATION=${RATE_LIMITER_DURATION:-1}
# File upload limits
- MAX_PAYLOAD_SIZE=${MAX_PAYLOAD_SIZE:-16mb}
- FILES_MAX_UPLOAD_SIZE=${FILES_MAX_UPLOAD_SIZE:-16mb}
# CORS configuration
- CORS_ENABLED=${CORS_ENABLED:-true}
- CORS_ORIGIN=${CORS_ORIGIN:-true}
- CORS_CREDENTIALS=${CORS_CREDENTIALS:-true}
# Telemetry
- TELEMETRY=${TELEMETRY:-false}
# Environment
- NODE_ENV=${NODE_ENV:-production}
- LOG_LEVEL=${LOG_LEVEL:-info}
# Migration configuration
- MIGRATIONS_PATH=${MIGRATIONS_PATH:-/directus/migrations}
# IPFS configuration for seed data generation
- IPFS_GATEWAY=${IPFS_GATEWAY:-http://127.0.0.1:8080}
- IPFS_CODEX_HASH=${IPFS_CODEX_HASH:-QmNdMnuJURo3sFkLR2WLSshPqycfjafbHoAcd2FTdBJ8S5}
# The Graph API configuration
- THE_GRAPH_API_KEY=${THE_GRAPH_API_KEY}
# Optional: override the gateway base URL (e.g. route via a proxy to bypass Cloudflare IP blocks)
- THE_GRAPH_GATEWAY_URL=${THE_GRAPH_GATEWAY_URL:-https://gateway.thegraph.com}
# Fallback when the gateway fails: self-hosted graph-node serving the same subgraph deployment (no API key)
- THE_GRAPH_FALLBACK_URL=${THE_GRAPH_FALLBACK_URL:-https://mainnet-graph.deploy.qwellco.de/subgraphs/name/moca/decc0s}
# Admin token for directus-sync
- ADMIN_TOKEN=${ADMIN_TOKEN}
volumes:
- directus-uploads:/directus/uploads
- directus-database:/directus/database
- directus-codex-seed:/directus/extensions/directus-extension-codex/seed
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
# Directus 12.3+ requires authentication for /server/health (403 otherwise)
test: ["CMD-SHELL", "curl -sf -H \"Authorization: Bearer $$ADMIN_TOKEN\" http://localhost:8055/server/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_interval: 5s
start_period: 40s
restart: unless-stopped
postgres:
image: postgis/postgis:16-3.4
environment:
- POSTGRES_DB=${POSTGRES_DB:-codex}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --lc-collate=C --lc-ctype=C
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "--host=localhost", "--username=${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_interval: 5s
start_period: 30s
restart: unless-stopped
redis:
image: redis:7-alpine
command: >
redis-server
--requirepass ${SERVICE_PASSWORD_REDIS}
--maxmemory 256mb
--maxmemory-policy allkeys-lru
--maxmemory-samples 5
ports:
- 6379:6379
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "[ $$(redis-cli --no-auth-warning -a ${SERVICE_PASSWORD_REDIS} ping) = 'PONG' ]"]
interval: 10s
timeout: 5s
retries: 5
start_interval: 5s
start_period: 15s
restart: unless-stopped
volumes:
directus-uploads:
directus-database:
directus-codex-seed:
postgres-data:
redis-data: