forked from Ethereal-Future/FuTuRe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
132 lines (127 loc) · 3.54 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
132 lines (127 loc) · 3.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
# docker-compose.dev.yml
# Development override — hot-reload for backend (node --watch) and frontend (Vite HMR).
# Usage:
# docker compose -f docker-compose.dev.yml up
#
# Source directories are mounted as volumes so any file change is reflected
# immediately without rebuilding the image. Prisma migrations run on startup.
services:
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_DB: future_remittance
POSTGRES_USER: future_admin
POSTGRES_PASSWORD: dev_password
ports:
- "5432:5432"
volumes:
- db_data_dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U future_admin -d future_remittance"]
interval: 5s
timeout: 5s
retries: 10
deploy:
resources:
limits:
cpus: "1.0"
memory: 1G
reservations:
cpus: "0.25"
memory: 256M
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
reservations:
cpus: "0.1"
memory: 128M
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3001:3001"
volumes:
# Mount source and prisma for instant hot-reload — no image rebuild needed
- ./backend/src:/app/src
- ./backend/prisma:/app/prisma
deploy:
resources:
limits:
# Mirrors infra/variables.tf backend_cpu/backend_memory defaults
# (512 CPU units = 0.5 vCPU, 1024 MiB) for local/production parity.
cpus: "0.5"
memory: 1024M
reservations:
cpus: "0.25"
memory: 512M
environment:
APP_ENV: development
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgresql://future_admin:dev_password@postgres:5432/future_remittance
REDIS_URL: redis://redis:6379
STELLAR_NETWORK: testnet
HORIZON_URL: https://horizon-testnet.stellar.org
ALLOWED_ORIGINS: http://localhost:3000
JWT_SECRET: dev-jwt-secret-change-me
STREAM_SECRET_ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
FEE_BUMP_THRESHOLD_XLM: "2"
LOG_LEVEL: debug
CACHE_TTL_BALANCE_S: "30"
RATE_CACHE_TTL_S: "60"
CACHE_TTL_FEE_S: "120"
RATE_LIMIT_WINDOW_MS: "60000"
RATE_LIMIT_MAX: "100"
DB_POOL_MAX: "10"
DB_SHARD_COUNT: "1"
CDN_ENABLED: "false"
# node --watch provides hot-reload without nodemon; migrate on each start
command: sh -c "npx prisma migrate deploy && node --watch src/server.js"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
restart: unless-stopped
depends_on:
- backend
ports:
- "3000:3000"
volumes:
# Mount source files for Vite HMR
- ./frontend/src:/app/src
- ./frontend/public:/app/public
- ./frontend/index.html:/app/index.html
environment:
VITE_API_URL: http://localhost:3001
# Vite listens on all interfaces inside the container
HOST: "0.0.0.0"
deploy:
resources:
limits:
cpus: "0.25"
memory: 256M
reservations:
cpus: "0.1"
memory: 128M
volumes:
db_data_dev: