forked from AgesEmpire/StellarSwipe-Backends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (97 loc) · 3.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (97 loc) · 3.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
version: '3.8'
# ─────────────────────────────────────────────────────────────────────────────
# Available profiles
# (none) Full stack — app + postgres + redis (default)
# db-only Postgres only, useful for DB-focused module tests
# cache-only Redis only, useful for cache-focused module tests
#
# Examples:
# docker-compose up -d # full stack
# docker-compose --profile db-only up -d # postgres only
# docker-compose --profile cache-only up -d # redis only
# ─────────────────────────────────────────────────────────────────────────────
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: stellarswipe-app
ports:
- '3000:3000'
environment:
NODE_ENV: development
PORT: 3000
HOST: 0.0.0.0
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password}
DATABASE_NAME: ${DATABASE_NAME:-stellarswipe}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:3000}
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
STELLAR_HORIZON_URL: ${STELLAR_HORIZON_URL:-https://horizon-testnet.stellar.org}
STELLAR_SOROBAN_RPC_URL: ${STELLAR_SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org:443}
STELLAR_NETWORK_PASSPHRASE: ${STELLAR_NETWORK_PASSPHRASE:-Test SDF Network ; September 2015}
volumes:
- .:/app
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:3000/api/v1/health/healthz || exit 1']
interval: 15s
timeout: 5s
retries: 5
start_period: 60s
networks:
- stellarswipe-network
command: npm run start:dev
postgres:
image: postgres:15-alpine
container_name: stellarswipe-postgres
profiles:
- db-only
environment:
POSTGRES_USER: ${DATABASE_USER:-postgres}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password}
POSTGRES_DB: ${DATABASE_NAME:-stellarswipe}
ports:
- '${DATABASE_PORT:-5432}:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DATABASE_USER:-postgres}']
interval: 10s
timeout: 5s
retries: 5
networks:
- stellarswipe-network
redis:
image: redis:7-alpine
container_name: stellarswipe-redis
profiles:
- cache-only
ports:
- '${REDIS_PORT:-6379}:6379'
command: redis-server ${REDIS_PASSWORD:+--requirepass $REDIS_PASSWORD}
volumes:
- redis_data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
networks:
- stellarswipe-network
volumes:
postgres_data:
redis_data:
networks:
stellarswipe-network:
driver: bridge