-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (116 loc) · 4.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
122 lines (116 loc) · 4.3 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
# =============================================================================
# GuildPass — Production-like local deployment
# =============================================================================
# Start with:
# docker compose build
# docker compose up -d
#
# Before starting, copy the environment template and fill in your values:
# cp .env.example .env
#
# Note: This compose file is designed for **production-like** local testing.
# For actual production, consider using Kubernetes, ECS, or similar.
# =============================================================================
services:
# ── PostgreSQL (shared database) ─────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: guildpass-postgres
restart: unless-stopped
environment:
POSTGRES_USER: guildpass
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-guildpass_dev}
POSTGRES_DB: guildpass
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U guildpass"]
interval: 5s
timeout: 5s
retries: 5
# ── Access API (blockchain indexer + core API) ─────────────────────
access-api:
build:
context: .
dockerfile: apps/access-api/Dockerfile
container_name: guildpass-access-api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
env_file:
- .env
environment:
DATABASE_URL: postgresql://guildpass:${POSTGRES_PASSWORD:-guildpass_dev}@postgres:5432/guildpass?schema=public
PORT: "3001"
HOST: "0.0.0.0"
ports:
- "3001:3001"
# ── Dashboard (Next.js web app) — Instance A ──────────────────────
dashboard:
build:
context: .
dockerfile: apps/dashboard/Dockerfile
container_name: guildpass-dashboard
restart: unless-stopped
depends_on:
- access-api
env_file:
- .env
environment:
DASHBOARD_API_MODE: ${DASHBOARD_API_MODE:-live}
DASHBOARD_STORAGE_MODE: ${DASHBOARD_STORAGE_MODE:-durable}
GUILD_PASS_CORE_URL: http://access-api:3001
DATABASE_URL: postgresql://guildpass:${POSTGRES_PASSWORD:-guildpass_dev}@postgres:5432/guildpass?schema=public
WEBHOOK_SECRET: ${WEBHOOK_SECRET:-dev-webhook-secret}
ACTIVITY_STORAGE_MODE: file
ACTIVITY_STORAGE_DIR: /app/apps/dashboard/.guildpass-activity
ports:
- "3000:3000"
# ── Dashboard (Next.js web app) — Instance B (multi-instance test) ─
# This second instance demonstrates cross-instance pub/sub delivery.
# Both instances share the same Postgres backend and database.
# Webhooks ingested by either instance will reach SSE clients on both.
dashboard-2:
build:
context: .
dockerfile: apps/dashboard/Dockerfile
container_name: guildpass-dashboard-2
restart: unless-stopped
depends_on:
- access-api
env_file:
- .env
environment:
DASHBOARD_API_MODE: ${DASHBOARD_API_MODE:-live}
DASHBOARD_STORAGE_MODE: ${DASHBOARD_STORAGE_MODE:-durable}
GUILD_PASS_CORE_URL: http://access-api:3001
DATABASE_URL: postgresql://guildpass:${POSTGRES_PASSWORD:-guildpass_dev}@postgres:5432/guildpass?schema=public
WEBHOOK_SECRET: ${WEBHOOK_SECRET:-dev-webhook-secret}
ACTIVITY_STORAGE_MODE: file
ACTIVITY_STORAGE_DIR: /app/apps/dashboard/.guildpass-activity-2
ports:
- "3002:3000"
# ── Discord Bot ─────────────────────────────────────────────────────
discord-bot:
build:
context: .
dockerfile: apps/discord-bot/Dockerfile
container_name: guildpass-discord-bot
restart: unless-stopped
depends_on:
- access-api
env_file:
- .env
environment:
DISCORD_TOKEN: ${DISCORD_TOKEN:?DISCORD_TOKEN is required}
DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID:?DISCORD_CLIENT_ID is required}
GUILD_PASS_CORE_URL: http://access-api:3001
profiles:
- discord-bot
# Use --profile discord-bot to start the bot:
# docker compose --profile discord-bot up -d
volumes:
pgdata: