-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (114 loc) · 3.65 KB
/
docker-compose.yml
File metadata and controls
118 lines (114 loc) · 3.65 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
# Docker Compose for Local Development
# =============================================================================
# This configuration builds and runs all services locally using Docker.
#
# Usage:
# docker compose up --build # Build and start all services
# docker compose up -d # Start in detached mode
# docker compose logs -f # Follow logs
# docker compose down # Stop and remove containers
#
# Note: For local HTTPS, you'll still need Caddy running on the host.
# This compose file exposes services on their default ports.
# =============================================================================
services:
auth:
build:
context: .
dockerfile: apps/auth/Dockerfile
container_name: core-exchange-auth
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- OP_ISSUER=${OP_ISSUER:-https://id.localtest.me}
- OP_PORT=3001
- CLIENT_ID=${CLIENT_ID:-dev-rp}
- CLIENT_SECRET=${CLIENT_SECRET:-dev-secret-CHANGE-FOR-PRODUCTION}
- REDIRECT_URI=${REDIRECT_URI:-https://app.localtest.me/callback}
- API_AUDIENCE=${API_AUDIENCE:-api://my-api}
- LOG_LEVEL=${LOG_LEVEL:-info}
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/.well-known/openid-configuration"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
restart: unless-stopped
api:
build:
context: .
dockerfile: apps/api/Dockerfile
container_name: core-exchange-api
ports:
- "3003:3003"
environment:
- NODE_ENV=production
- OP_ISSUER=${OP_ISSUER:-https://id.localtest.me}
- API_HOST=${API_HOST:-https://api.localtest.me}
- API_PORT=3003
- API_AUDIENCE=${API_AUDIENCE:-api://my-api}
- LOG_LEVEL=${LOG_LEVEL:-info}
depends_on:
auth:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3003/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
restart: unless-stopped
app:
build:
context: .
dockerfile: apps/app/Dockerfile
container_name: core-exchange-app
ports:
- "3004:3004"
environment:
- NODE_ENV=production
- OP_ISSUER=${OP_ISSUER:-https://id.localtest.me}
- APP_HOST=${APP_HOST:-https://app.localtest.me}
- APP_PORT=3004
- CLIENT_ID=${CLIENT_ID:-dev-rp}
- CLIENT_SECRET=${CLIENT_SECRET:-dev-secret-CHANGE-FOR-PRODUCTION}
- REDIRECT_URI=${REDIRECT_URI:-https://app.localtest.me/callback}
- API_BASE_URL=${API_BASE_URL:-https://api.localtest.me}
- API_AUDIENCE=${API_AUDIENCE:-api://my-api}
- COOKIE_SECRET=${COOKIE_SECRET:-dev-cookie-secret-CHANGE-FOR-PRODUCTION}
- LOG_LEVEL=${LOG_LEVEL:-info}
depends_on:
auth:
condition: service_healthy
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3004/"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
restart: unless-stopped
# Optional: Add a Caddy service for HTTPS termination
# Uncomment the following to include Caddy in the compose stack
#
# caddy:
# image: caddy:2-alpine
# container_name: core-exchange-caddy
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./caddyfile:/etc/caddy/Caddyfile:ro
# - caddy_data:/data
# - caddy_config:/config
# depends_on:
# - auth
# - api
# - app
# restart: unless-stopped
#
# volumes:
# caddy_data:
# caddy_config: