forked from Lex-Studios/Stellar-Spend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (109 loc) · 3.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
114 lines (109 loc) · 3.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
services:
# ── Application ─────────────────────────────────────────────────────────────
app:
build:
context: .
dockerfile: Dockerfile
cache_from:
- stellar-spend:latest
image: stellar-spend:latest
ports:
- '3000:3000'
env_file:
- .env.local
environment:
DATABASE_URL: postgresql://stellar:stellar@postgres:5432/stellar_spend
REDIS_URL: redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://localhost:3000/api/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
networks:
- stellar-net
# ── PostgreSQL ───────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: stellar
POSTGRES_PASSWORD: stellar
POSTGRES_DB: stellar_spend
ports:
- '5432:5432'
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U stellar -d stellar_spend']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
networks:
- stellar-net
# ── Redis ────────────────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
command: redis-server --save 60 1 --loglevel warning
ports:
- '6379:6379'
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
deploy:
resources:
limits:
memory: 128M
reservations:
memory: 64M
networks:
- stellar-net
# ── Database migrations ──────────────────────────────────────────────────────
migrate:
build:
context: .
dockerfile: Dockerfile
target: builder
command: npx ts-node scripts/migrate.ts
environment:
DATABASE_URL: postgresql://stellar:stellar@postgres:5432/stellar_spend
depends_on:
postgres:
condition: service_healthy
profiles:
- migrate
networks:
- stellar-net
volumes:
postgres-data:
driver: local
redis-data:
driver: local
networks:
stellar-net:
driver: bridge