forked from Xoulomon/Stellar-Save
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
161 lines (152 loc) · 5.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
161 lines (152 loc) · 5.28 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
version: '3.9'
# One-command local development stack for Stellar-Save.
# Usage: docker compose up --build
#
# Services:
# postgres — PostgreSQL 16 (database)
# redis — Redis 7 (cache / rate-limit store)
# backend — Express/TypeScript API on :3001
# frontend — Vite dev server on :5173
# quickstart — Stellar Quickstart node (local Soroban) on :8000/:11625
# seed — One-shot container that deploys the contract and seeds test data
services:
# ── Infrastructure ────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: stellar_save
POSTGRES_USER: stellar
POSTGRES_PASSWORD: stellar_dev
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stellar -d stellar_save"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
# ── Local Stellar / Soroban node ─────────────────────────────────────────
quickstart:
image: stellar/quickstart:latest
platform: linux/amd64
ports:
- "8000:8000" # Horizon HTTP
- "11625:11625" # Stellar core peer
command: --standalone --enable-soroban-rpc
environment:
NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
# ── Backend API ───────────────────────────────────────────────────────────
backend:
build:
context: ./backend
target: builder # dev stage: keep ts-node / tsx
command: ["npx", "tsx", "src/index.ts"]
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgresql://stellar:stellar_dev@postgres:5432/stellar_save
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ""
STELLAR_NETWORK: standalone
STELLAR_RPC_URL: http://quickstart:8000/soroban/rpc
STELLAR_NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
JWT_SECRET: local-dev-jwt-secret-change-in-prod
BACKUP_ENABLED: "false"
INDEXER_ENABLED: "false"
IPFS_ENABLED: "true"
IPFS_API_URL: http://ipfs:5001
IPFS_GATEWAY_URL: http://ipfs:8080
ports:
- "3001:3001"
volumes:
- ./backend/src:/app/src:ro # hot-reload source
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ipfs:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:3001/health || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
# ── Frontend ──────────────────────────────────────────────────────────────
frontend:
image: node:20-alpine
working_dir: /app
command: ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
restart: unless-stopped
environment:
VITE_STELLAR_NETWORK: standalone
VITE_STELLAR_RPC_URL: http://localhost:8000/soroban/rpc
VITE_API_URL: http://localhost:3001
ports:
- "5173:5173"
volumes:
- ./frontend:/app:ro
- frontend-node-modules:/app/node_modules
depends_on:
- backend
# ── IPFS node (Kubo) ──────────────────────────────────────────────────────
ipfs:
image: ipfs/kubo:latest
restart: unless-stopped
ports:
- "5001:5001" # RPC API
- "8080:8080" # Gateway
- "4001:4001" # Swarm
volumes:
- ipfs-data:/data/ipfs
environment:
IPFS_PROFILE: server
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:5001/api/v0/id || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# ── Seed: deploy contract + insert test data ──────────────────────────────
seed:
image: node:20-alpine
working_dir: /seed
entrypoint: ["sh", "/seed/seed.sh"]
environment:
DATABASE_URL: postgresql://stellar:stellar_dev@postgres:5432/stellar_save
STELLAR_RPC_URL: http://quickstart:8000/soroban/rpc
STELLAR_NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
BACKEND_URL: http://backend:3001
volumes:
- ./scripts/seed.sh:/seed/seed.sh:ro
depends_on:
backend:
condition: service_healthy
quickstart:
condition: service_healthy
restart: "no"
volumes:
postgres-data:
frontend-node-modules:
ipfs-data: