-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
180 lines (171 loc) · 5.1 KB
/
docker-compose.dev.yml
File metadata and controls
180 lines (171 loc) · 5.1 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
services:
# ==================== Caddy Reverse Proxy ====================
caddy:
image: caddy:2.8-alpine
container_name: gaap-caddy-dev
restart: unless-stopped
ports:
- "${CADDY_HTTP_PORT:-80}:80"
- "${CADDY_HTTPS_PORT:-443}:443"
- "2019:2019" # Caddy Admin API
volumes:
# Caddy configuration
- ./config/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
# Persistent data (certificates, etc.)
- ./volumes/caddy/data:/data
- ./volumes/caddy/config:/config
# User uploads (if serving static files)
- ./volumes/uploads:/var/www/uploads
environment:
- DEV_DOMAIN=${DEV_DOMAIN:-gaap.local}
depends_on:
- gaap-api
- gaap-web
networks:
- gaap-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:2019/config/"]
interval: 30s
timeout: 10s
retries: 3
# ==================== Backend: GoFrame API ====================
gaap-api:
build:
context: ./gaap-api
dockerfile: Dockerfile.dev
target: development
container_name: gaap-api-dev
restart: unless-stopped
expose:
- "8000" # Only expose to internal network
ports:
- "${DELVE_PORT:-40000}:40000" # Delve debugger
volumes:
- ./gaap-api:/app
- go-mod-cache:/go/pkg/mod
- ./volumes/exports:/app/exports
- ./volumes/imports:/app/imports
environment:
- GF_ENV=${GF_ENV}
- GF_DEBUG=${GF_DEBUG}
- GF_LOG_LEVEL=${GF_LOG_LEVEL}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_INTERNAL_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_INTERNAL_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- RABBITMQ_HOST=${RABBITMQ_HOST}
- RABBITMQ_PORT=${RABBITMQ_INTERNAL_PORT}
- RABBITMQ_USER=${RABBITMQ_USER}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
- JWT_ACCESS_TOKEN_EXPIRY=${JWT_ACCESS_TOKEN_EXPIRY}
- JWT_REFRESH_TOKEN_EXPIRY=${JWT_REFRESH_TOKEN_EXPIRY}
- ALE_BOOTSTRAP_KEY=${ALE_BOOTSTRAP_KEY}
- ENABLE_DELVE=${ENABLE_DELVE}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
rabbitmq:
condition: service_healthy
networks:
- gaap-network
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
- apparmor:unconfined
# ==================== Frontend: Next.js Web ====================
gaap-web:
build:
context: ./gaap-web
dockerfile: Dockerfile.dev
target: development
container_name: gaap-web-dev
restart: unless-stopped
expose:
- "3000" # Only expose to internal network
volumes:
- ./gaap-web:/app
- /app/node_modules
- /app/.next
environment:
- NODE_ENV=${NODE_ENV}
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
- NEXT_PUBLIC_ALE_BOOTSTRAP_KEY=${ALE_BOOTSTRAP_KEY}
- USE_NODEMON=${USE_NODEMON:-false}
# Allow Next.js to accept requests from Caddy
- HOSTNAME=0.0.0.0
depends_on:
- gaap-api
networks:
- gaap-network
# ==================== PostgreSQL Database ====================
postgres:
image: postgres:18
container_name: gaap-postgres-dev
restart: unless-stopped
ports:
- "${POSTGRES_PORT:-5432}:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
- ./gaap-api/manifest/sql:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- gaap-network
# ==================== Redis Cache ====================
redis:
image: redis:7-alpine
container_name: gaap-redis-dev
restart: unless-stopped
ports:
- "${REDIS_PORT:-6379}:6379"
command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes
volumes:
- ./volumes/redis:/data
networks:
- gaap-network
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
# ==================== RabbitMQ Message Queue ====================
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: gaap-rabbitmq-dev
restart: unless-stopped
ports:
- "${RABBITMQ_PORT:-5672}:5672"
- "${RABBITMQ_MANAGEMENT_PORT:-15672}:15672"
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
volumes:
- ./volumes/rabbitmq:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- gaap-network
volumes:
go-mod-cache:
networks:
gaap-network:
driver: bridge