-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
146 lines (138 loc) · 4.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
146 lines (138 loc) · 4.54 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
# Every service belongs to a profile, so `docker compose up` on its own starts
# nothing and you always say which stack you want:
#
# docker compose --profile dev up backend + postgres + redis
# docker compose --profile full up the same, plus the built frontend
# docker compose --profile test up API under test + its own database
# docker compose --profile integration up local standalone Stellar network
#
# dev and test use separate databases on separate host ports, so both can run
# at once without colliding.
services:
# ── dev ────────────────────────────────────────────────────────────────────
postgres:
profiles: ["dev", "full"]
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: stellar_tags
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
redis:
profiles: ["dev", "full"]
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
backend:
profiles: ["dev", "full"]
build:
context: .
dockerfile: Dockerfile
target: backend
ports:
- "5000:5000"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/stellar_tags?schema=public
REDIS_URL: redis://redis:6379
PORT: "5000"
LOG_DIR: /app/logs
volumes:
# Keep rotated logs across container restarts. The transports cap the
# volume's growth by rotating daily / at 20MB and pruning old archives.
- backendlogs:/app/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# Only in full, not dev: the Vite build is the slowest thing here and backend
# work does not need it. full is dev plus this.
frontend:
profiles: ["full"]
build:
context: .
dockerfile: Dockerfile
target: frontend
args:
VITE_API_BASE: http://localhost:5000
ports:
- "3000:80"
depends_on:
- backend
# ── test ───────────────────────────────────────────────────────────────────
postgres-test:
profiles: ["test"]
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: stellar_tags_test
# 5433 on the host so a dev postgres can stay up on 5432.
ports:
- "5433:5432"
# No volume: a test database should start empty every time.
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
api-test:
profiles: ["test"]
build:
context: ./stellar-payment-platform
dockerfile: Dockerfile.test
environment:
PORT: "5001"
DATABASE_URL: postgresql://postgres:postgres@postgres-test:5432/stellar_tags_test?schema=public
ports:
- "5001:5001"
depends_on:
postgres-test:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:5001/health"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
# ── integration ────────────────────────────────────────────────────────────
# Standalone Stellar network (Soroban-enabled) used by the contract
# integration tests. Exposes both the Horizon REST API (8000) and the
# Soroban RPC endpoint (8000/rpc) so the Rust SDK can submit real
# transactions against a local network. Kept out of the test profile
# because it pulls a multi-gigabyte image the API tests never touch.
stellar-standalone:
profiles: ["integration"]
image: stellar/quickstart:latest
command: [
"--standalone",
"--enable-soroban-rpc",
"--enable-core-artifacts",
"--local",
]
environment:
ENABLE_LOGS: "true"
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/"]
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
volumes:
pgdata:
backendlogs: