1- version : ' 3.8'
1+ # ---------------------------------------------------------------------------
2+ # Veridion full-stack development environment.
3+ #
4+ # docker compose up -d
5+ #
6+ # Starts: PostgreSQL, Redis, API (NestJS), and Web (Next.js).
7+ # The API runs Prisma migrations (`db push`) automatically on startup.
8+ # See `.env.example` for a full reference of available environment variables.
9+ # ---------------------------------------------------------------------------
210
311services :
412 postgres :
513 image : postgres:16-alpine
614 container_name : veridion-db
715 environment :
8- POSTGRES_USER : veridion
9- POSTGRES_PASSWORD : veridion
10- POSTGRES_DB : veridion
16+ POSTGRES_USER : ${POSTGRES_USER:- veridion}
17+ POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:- veridion}
18+ POSTGRES_DB : ${POSTGRES_DB:- veridion}
1119 ports :
12- - ' 5432:5432'
20+ - ' ${POSTGRES_PORT:- 5432} :5432'
1321 volumes :
1422 - postgres_data:/var/lib/postgresql/data
1523 healthcheck :
16- test : ['CMD-SHELL', 'pg_isready -U veridion']
24+ test : ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:- veridion} ']
1725 interval : 5s
1826 timeout : 5s
19- retries : 5
27+ retries : 10
2028
2129 redis :
2230 image : redis:7-alpine
2331 container_name : veridion-redis
2432 ports :
25- - ' 6379:6379'
33+ - ' ${REDIS_PORT:- 6379} :6379'
2634 volumes :
2735 - redis_data:/data
2836 healthcheck :
2937 test : ['CMD', 'redis-cli', 'ping']
3038 interval : 5s
3139 timeout : 5s
32- retries : 5
40+ retries : 10
3341
3442 api :
3543 build :
3644 context : .
3745 dockerfile : docker/Dockerfile.api
3846 container_name : veridion-api
3947 ports :
40- - ' 4000:4000'
48+ - ' ${PORT:- 4000} :4000'
4149 environment :
42- NODE_ENV : development
43- DATABASE_URL : postgresql://veridion:veridion@postgres:5432/veridion
50+ NODE_ENV : ${NODE_ENV:-development}
51+ PORT : 4000
52+ CORS_ORIGIN : ${CORS_ORIGIN:-http://localhost:3000}
53+ # Database
54+ DATABASE_URL : postgresql://${POSTGRES_USER:-veridion}:${POSTGRES_PASSWORD:-veridion}@postgres:5432/${POSTGRES_DB:-veridion}
55+ # Redis
56+ REDIS_HOST : redis
57+ REDIS_PORT : 6379
4458 REDIS_URL : redis://redis:6379
45- JWT_SECRET : dev-jwt-secret-change-in-production
46- JWT_REFRESH_SECRET : dev-refresh-secret-change-in-production
59+ # Auth
60+ JWT_SECRET : ${JWT_SECRET:-dev-secret}
61+ JWT_REFRESH_SECRET : ${JWT_REFRESH_SECRET:-dev-refresh-secret}
62+ JWT_EXPIRATION : ${JWT_EXPIRATION:-15m}
63+ JWT_REFRESH_EXPIRATION : ${JWT_REFRESH_EXPIRATION:-7d}
64+ # AI
65+ AI_PROVIDER : ${AI_PROVIDER:-openai}
66+ OPENAI_API_KEY : ${OPENAI_API_KEY:-}
67+ ANTHROPIC_API_KEY : ${ANTHROPIC_API_KEY:-}
68+ # Blockchain
69+ STELLAR_NETWORK : ${STELLAR_NETWORK:-testnet}
70+ STELLAR_RPC_URL : ${STELLAR_RPC_URL:-https://soroban-testnet.stellar.org}
71+ # Email
72+ SMTP_HOST : ${SMTP_HOST:-}
73+ SMTP_PORT : ${SMTP_PORT:-}
74+ SMTP_USER : ${SMTP_USER:-}
75+ SMTP_PASSWORD : ${SMTP_PASSWORD:-}
76+ EMAIL_FROM : ${EMAIL_FROM:-}
4777 depends_on :
4878 postgres :
4979 condition : service_healthy
5080 redis :
5181 condition : service_healthy
52- volumes :
53- - .:/app
54- - /app/node_modules
82+ healthcheck :
83+ test :
84+ [
85+ ' CMD-SHELL' ,
86+ ' node -e "fetch('' http://localhost:4000/api/v1/health'' ).then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"' ,
87+ ]
88+ interval : 15s
89+ timeout : 5s
90+ retries : 5
91+ start_period : 30s
92+ restart : unless-stopped
5593
5694 web :
5795 build :
@@ -61,12 +99,24 @@ services:
6199 ports :
62100 - ' 3000:3000'
63101 environment :
64- NEXT_PUBLIC_API_URL : http://localhost:4000/api/v1
102+ NODE_ENV : ${NODE_ENV:-development}
103+ NEXT_PUBLIC_APP_URL : ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
104+ NEXT_PUBLIC_API_URL : ${NEXT_PUBLIC_API_URL:-http://localhost:4000}
105+ NEXT_PUBLIC_STELLAR_NETWORK : ${NEXT_PUBLIC_STELLAR_NETWORK:-testnet}
65106 depends_on :
66- - api
67- volumes :
68- - .:/app
69- - /app/node_modules
107+ api :
108+ condition : service_healthy
109+ healthcheck :
110+ test :
111+ [
112+ ' CMD-SHELL' ,
113+ ' node -e "fetch('' http://localhost:3000'' ).then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"' ,
114+ ]
115+ interval : 15s
116+ timeout : 5s
117+ retries : 5
118+ start_period : 30s
119+ restart : unless-stopped
70120
71121volumes :
72122 postgres_data :
0 commit comments