-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
159 lines (151 loc) · 7.04 KB
/
docker-compose.dev.yml
File metadata and controls
159 lines (151 loc) · 7.04 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Development docker-compose with volume mounts for hot reloading
# Usage: ./scripts/start-dev.sh
# Features: User ID mapping, Swagger UI enabled, permission-free development
services:
api:
environment:
ASPNETCORE_ENVIRONMENT: Development
# OpenTelemetry tracing configuration
Telemetry__OtlpEndpoint: "http://jaeger:4317"
Telemetry__TracingEnabled: "true"
# Batch Cache Invalidation configuration (development settings)
CacheInvalidation__BatchingEnabled: "true"
CacheInvalidation__BatchWindow: "00:00:00.050" # 50ms - Faster for development
CacheInvalidation__MaxBatchSize: "50" # Smaller batches for easier debugging
CacheInvalidation__EnableCoalescing: "true"
# Batch Spending configuration (development settings)
BatchSpending__FlushIntervalSeconds: "1" # 1 second - Fast for testing
BatchSpending__MinimumIntervalSeconds: "1"
BatchSpending__MaximumIntervalSeconds: "3600" # 1 hour max for dev
BatchSpending__RedisTtlHours: "24"
# Health monitoring configuration - API endpoint checks
HealthMonitoring__ApiEndpoints__0__Name: AdminAPI
HealthMonitoring__ApiEndpoints__0__Url: http://admin:8080/health
HealthMonitoring__ApiEndpoints__0__TimeoutMs: 5000
HealthMonitoring__ApiEndpoints__0__WarningThresholdMs: 1000
# Cloudflare R2 configuration (default for development)
CONDUIT_MEDIA_STORAGE_TYPE: "${CONDUIT_MEDIA_STORAGE_TYPE:-S3}"
CONDUIT_S3_ENDPOINT: "${CONDUIT_S3_ENDPOINT}"
CONDUIT_S3_ACCESS_KEY: "${CONDUIT_S3_ACCESS_KEY}"
CONDUIT_S3_SECRET_KEY: "${CONDUIT_S3_SECRET_KEY}"
CONDUIT_S3_BUCKET_NAME: "${CONDUIT_S3_BUCKET_NAME:-conduit}"
CONDUIT_S3_REGION: "${CONDUIT_S3_REGION:-auto}"
# Public URL for R2 bucket (either public dev URL or custom domain)
CONDUIT_S3_PUBLIC_BASE_URL: "${CONDUIT_S3_PUBLIC_BASE_URL}"
admin:
environment:
ASPNETCORE_ENVIRONMENT: Development
# OpenTelemetry tracing configuration
Telemetry__OtlpEndpoint: "http://jaeger:4317"
Telemetry__TracingEnabled: "true"
# Batch Cache Invalidation configuration (development settings)
CacheInvalidation__BatchingEnabled: "true"
CacheInvalidation__BatchWindow: "00:00:00.050" # 50ms - Faster for development
CacheInvalidation__MaxBatchSize: "50" # Smaller batches for easier debugging
CacheInvalidation__EnableCoalescing: "true"
# Batch Spending configuration (development settings)
BatchSpending__FlushIntervalSeconds: "1" # 1 second - Fast for testing
BatchSpending__MinimumIntervalSeconds: "1"
BatchSpending__MaximumIntervalSeconds: "3600" # 1 hour max for dev
BatchSpending__RedisTtlHours: "24"
# Cloudflare R2 configuration (default for development)
CONDUIT_MEDIA_STORAGE_TYPE: "${CONDUIT_MEDIA_STORAGE_TYPE:-S3}"
CONDUIT_S3_ENDPOINT: "${CONDUIT_S3_ENDPOINT}"
CONDUIT_S3_ACCESS_KEY: "${CONDUIT_S3_ACCESS_KEY}"
CONDUIT_S3_SECRET_KEY: "${CONDUIT_S3_SECRET_KEY}"
CONDUIT_S3_BUCKET_NAME: "${CONDUIT_S3_BUCKET_NAME:-conduit}"
CONDUIT_S3_REGION: "${CONDUIT_S3_REGION:-auto}"
# Public URL for R2 bucket (either public dev URL or custom domain)
CONDUIT_S3_PUBLIC_BASE_URL: "${CONDUIT_S3_PUBLIC_BASE_URL}"
webadmin:
# Use Node 22 to match host environment
image: node:22-alpine
# Start as root to fix volume ownership, then switch to user
user: root
volumes:
# Mount source code for hot reloading
- ./WebAdmin:/app/WebAdmin
- ./SDKs:/app/SDKs
# Isolate .next directory so host and container builds don't conflict
- /app/WebAdmin/.next
environment:
# Next.js development settings
NODE_ENV: development
NEXT_TELEMETRY_DISABLED: 1
WATCHPACK_POLLING: "true"
CHOKIDAR_USEPOLLING: "true"
CHOKIDAR_INTERVAL: 1000
FAST_REFRESH: "true"
PORT: 3000
# Backend service URLs
CONDUIT_API_TO_API_BACKEND_AUTH_KEY: alpha
CONDUIT_API_BASE_URL: http://api:8080
CONDUIT_ADMIN_API_BASE_URL: http://admin:8080
CONDUIT_API_EXTERNAL_URL: http://localhost:5000
CONDUIT_ADMIN_API_EXTERNAL_URL: http://localhost:5002
# Clerk authentication (using the test keys from docker-compose.yml)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "pk_test_cHJlY2lzZS1yaW5ndGFpbC0zMy5jbGVyay5hY2NvdW50cy5kZXYk"
CLERK_SECRET_KEY: "sk_test_oOI6FRt1EhRGaCVUc1zJVyWCNyqf3w1DSJnLZlxEQK"
# Development authentication bypass
CLERK_AUTH_ENABLED: "false"
# Official Next.js Docker configuration from docs
HOSTNAME: "0.0.0.0"
working_dir: /app/WebAdmin
# Smarter startup that handles both fresh installs and fast restarts
command: |
sh -c "
echo 'Installing su-exec for user switching...'
apk add --no-cache su-exec
echo 'Fixing directory ownership...'
# Fix ownership of all mounted directories
chown -R ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000} /app/WebAdmin || true
chown -R ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000} /app/SDKs || true
# Check if we should skip dependency installation (fast mode)
if [ \"\${SKIP_NPM_INSTALL:-false}\" = \"true\" ]; then
echo 'FAST MODE: Skipping dependency installation'
else
# Check if node_modules exists
if [ ! -d /app/WebAdmin/node_modules ] || [ \"\${FORCE_NPM_INSTALL:-false}\" = \"true\" ]; then
echo 'Installing dependencies (this will be visible on host)...'
su-exec ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000} sh -c '
cd /app/SDKs/Node/Common && npm install && npm run build
cd /app/SDKs/Node/Admin && npm install && npm run build
cd /app/SDKs/Node/Core && npm install && npm run build
cd /app/WebAdmin && npm install
'
else
echo 'Dependencies already installed, checking for updates...'
su-exec ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000} sh -c '
cd /app/SDKs/Node/Common && npm install
cd /app/SDKs/Node/Admin && npm install
cd /app/SDKs/Node/Core && npm install
cd /app/WebAdmin && npm install
'
fi
fi
echo 'Starting development server...'
su-exec ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000} sh -c 'cd /app/WebAdmin && npm run dev'
"
ports:
- "3000:3000"
depends_on:
admin:
condition: service_healthy
api:
condition: service_healthy
# Jaeger for distributed tracing visualization
jaeger:
image: jaegertracing/all-in-one:1.53
environment:
- COLLECTOR_OTLP_ENABLED=true
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:16686"]
interval: 10s
timeout: 5s
retries: 3
# MinIO services removed - using Cloudflare R2 instead
# To use MinIO instead of R2, see docker-compose.minio.yml