2026-10-23 11:43:49 -05:00
services :
# Next.js Frontend & Admin Console (Port 3000)
web :
build :
context : ..
dockerfile : docker/Dockerfile.web
2026-10-23 20:53:34 -07:00
expose :
- "3000"
2026-11-16 23:22:11 +06:00
volumes :
- datastack-data:/app/storage
2026-10-23 11:43:49 -05:00
environment :
2026-10-23 19:56:38 -07:00
NODE_ENV : production
PORT : "3000"
2026-11-17 20:05:00 +06:00
INGESTION_INTERNAL_URL : "http://ingestion:4000"
2026-10-25 04:11:00 -07:00
DATASTACK_JWT_SECRET : "${SERVICE_REALBASE64_64_JWT:?Coolify must generate SERVICE_REALBASE64_64_JWT}"
2026-11-18 05:42:19 +06:00
DATASTACK_INTERNAL_SECRET : "${DATASTACK_INTERNAL_SECRET:-${SERVICE_REALBASE64_64_INTERNAL:-}}"
2026-11-16 23:22:11 +06:00
DATASTACK_ADMIN_EMAIL : "${DATASTACK_ADMIN_EMAIL:-admin@datastack.dev}"
2026-10-25 04:11:00 -07:00
DATASTACK_ADMIN_SESSION_SECRET : "${SERVICE_REALBASE64_64_ADMINSESSION:?Coolify must generate SERVICE_REALBASE64_64_ADMINSESSION}"
2026-10-25 06:12:47 -07:00
DATASTACK_ADMIN_SETUP_KEY : "${SERVICE_REALBASE64_64_ADMININSTALL:?Coolify must generate SERVICE_REALBASE64_64_ADMININSTALL}"
DATABASE_URL : "postgresql://datastack:${SERVICE_PASSWORD_64_POSTGRES:?Coolify must generate SERVICE_PASSWORD_64_POSTGRES}@postgres:5432/${SERVICE_HEX_32_DATABASENAME:?Coolify must generate SERVICE_HEX_32_DATABASENAME}"
2026-11-18 05:18:55 +06:00
REDIS_URL : "redis://redis:6379"
2026-11-16 23:22:11 +06:00
depends_on :
postgres :
condition : service_healthy
2026-11-18 05:18:55 +06:00
redis :
condition : service_healthy
2026-10-23 11:43:49 -05:00
restart : unless-stopped
2026-11-19 20:22:01 +06:00
stop_grace_period : 20s
2026-10-23 19:56:38 -07:00
healthcheck :
test :
[
"CMD" ,
"node" ,
"-e" ,
2026-11-18 05:42:19 +06:00
"fetch('http://127.0.0.1:3000/api/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))" ,
2026-10-23 19:56:38 -07:00
]
interval : 30s
timeout : 5s
retries : 3
start_period : 30s
2026-10-23 11:43:49 -05:00
# Express + Socket.IO Ingestion Engine (Port 4000)
ingestion :
build :
context : ..
dockerfile : docker/Dockerfile.server
2026-10-23 20:53:34 -07:00
expose :
- "4000"
2026-10-23 11:43:49 -05:00
volumes :
2026-10-23 19:56:38 -07:00
- datastack-data:/app/storage
2026-10-23 11:43:49 -05:00
environment :
2026-10-23 19:56:38 -07:00
NODE_ENV : production
PORT_SOCKET : "4000"
2026-10-25 04:11:00 -07:00
DATASTACK_JWT_SECRET : "${SERVICE_REALBASE64_64_JWT:?Coolify must generate SERVICE_REALBASE64_64_JWT}"
2026-11-18 05:42:19 +06:00
DATASTACK_INTERNAL_SECRET : "${DATASTACK_INTERNAL_SECRET:-${SERVICE_REALBASE64_64_INTERNAL:-}}"
2026-11-17 20:05:00 +06:00
DATABASE_URL : "postgresql://datastack:${SERVICE_PASSWORD_64_POSTGRES:?Coolify must generate SERVICE_PASSWORD_64_POSTGRES}@postgres:5432/${SERVICE_HEX_32_DATABASENAME:?Coolify must generate SERVICE_HEX_32_DATABASENAME}"
2026-11-18 05:18:55 +06:00
REDIS_URL : "redis://redis:6379"
2026-11-19 20:22:01 +06:00
DATASTACK_CORS_ORIGINS : "${DATASTACK_CORS_ORIGINS:-}"
2026-11-17 20:05:00 +06:00
depends_on :
postgres :
condition : service_healthy
2026-11-18 05:18:55 +06:00
redis :
condition : service_healthy
2026-10-23 11:43:49 -05:00
restart : unless-stopped
2026-11-19 20:22:01 +06:00
stop_grace_period : 20s
2026-10-23 19:56:38 -07:00
healthcheck :
test :
[
"CMD" ,
"node" ,
"-e" ,
"fetch('http://127.0.0.1:4000/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))" ,
]
interval : 30s
timeout : 5s
retries : 3
start_period : 10s
2026-10-23 11:43:49 -05:00
2026-10-23 20:53:34 -07:00
# Coolify routes the public domain to this service on its internal port 80.
proxy :
build :
context : ..
dockerfile : docker/Dockerfile.proxy
expose :
- "80"
depends_on :
web :
condition : service_healthy
ingestion :
condition : service_healthy
restart : unless-stopped
healthcheck :
2026-11-18 05:42:19 +06:00
test : [ "CMD-SHELL" , "wget -q -O /dev/null http://127.0.0.1/api/health || exit 1" ]
2026-10-23 20:53:34 -07:00
interval : 30s
timeout : 5s
retries : 3
start_period : 10s
2026-11-18 05:18:55 +06:00
# Shared Redis ingestion buffer & distributed flush coordination
2026-10-23 11:43:49 -05:00
redis :
image : redis:7-alpine
2026-11-18 05:42:19 +06:00
command : [ "redis-server" , "--appendonly" , "yes" ]
volumes :
- redisdata:/data
2026-10-23 11:43:49 -05:00
restart : unless-stopped
2026-10-23 19:56:38 -07:00
healthcheck :
test : [ "CMD" , "redis-cli" , "ping" ]
interval : 30s
timeout : 5s
retries : 3
2026-10-23 11:43:49 -05:00
2026-11-16 23:22:11 +06:00
# PostgreSQL stores the bootstrap admin credential and login throttle state in pgdata.
2026-10-23 11:43:49 -05:00
postgres :
image : postgres:16-alpine
environment :
2026-10-23 19:56:38 -07:00
POSTGRES_USER : datastack
2026-10-25 04:11:00 -07:00
POSTGRES_PASSWORD : "${SERVICE_PASSWORD_64_POSTGRES:?Coolify must generate SERVICE_PASSWORD_64_POSTGRES}"
2026-10-25 06:12:47 -07:00
POSTGRES_DB : "${SERVICE_HEX_32_DATABASENAME:?Coolify must generate SERVICE_HEX_32_DATABASENAME}"
2026-10-23 11:43:49 -05:00
volumes :
- pgdata:/var/lib/postgresql/data
restart : unless-stopped
2026-10-23 19:56:38 -07:00
healthcheck :
2026-10-25 06:12:47 -07:00
test : [ "CMD-SHELL" , 'pg_isready -U datastack -d "$$POSTGRES_DB"' ]
2026-10-23 19:56:38 -07:00
interval : 10s
timeout : 5s
retries : 5
2026-10-23 11:43:49 -05:00
volumes :
2026-10-23 19:56:38 -07:00
datastack-data :
2026-10-23 11:43:49 -05:00
pgdata :
2026-11-18 05:42:19 +06:00
redisdata :