forked from AetherEdu/AetherMint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (175 loc) · 5.49 KB
/
Copy pathdocker-compose.yml
File metadata and controls
183 lines (175 loc) · 5.49 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
181
182
183
version: "3.9"
# =============================================================================
# AetherMint - Docker Compose for Local Development
# =============================================================================
#
# Usage:
# docker compose up # Start all services
# docker compose up frontend # Start only frontend
# docker compose up backend # Start only backend
# docker compose up --build # Rebuild and start
# docker compose down # Stop and remove containers
# docker compose down -v # Also remove volumes
#
# Access:
# Frontend: http://localhost:3000
# Backend: http://localhost:3001
# PostgreSQL: localhost:5432
# Redis: localhost:6379
# MongoDB: localhost:27017
# =============================================================================
services:
# --------------------------------------------------------------------------
# Frontend - Next.js application
# --------------------------------------------------------------------------
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
BUILD_DATE: "${BUILD_DATE:-unknown}"
VCS_REF: "${VCS_REF:-unknown}"
VERSION: "${VERSION:-0.1.0}"
container_name: aethermint-frontend
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=http://localhost:3001
- NEXT_PUBLIC_STELLAR_RECEIVER_ADDRESS=${NEXT_PUBLIC_STELLAR_RECEIVER_ADDRESS:-}
depends_on:
backend:
condition: service_healthy
networks:
- aethermint-network
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
# --------------------------------------------------------------------------
# Backend - Express API server
# --------------------------------------------------------------------------
backend:
build:
context: .
dockerfile: backend/Dockerfile
args:
BUILD_DATE: "${BUILD_DATE:-unknown}"
VCS_REF: "${VCS_REF:-unknown}"
VERSION: "${VERSION:-0.1.0}"
container_name: aethermint-backend
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- PORT=3001
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=aethermint
- DB_USER=aethermint
- DB_PASSWORD=${DB_PASSWORD:-aethermint_dev}
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- MONGODB_URI=mongodb://mongodb:27017/aethermint
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- aethermint-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
# --------------------------------------------------------------------------
# PostgreSQL - Primary database
# --------------------------------------------------------------------------
postgres:
image: postgres:16-alpine
container_name: aethermint-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_DB=aethermint
- POSTGRES_USER=aethermint
- POSTGRES_PASSWORD=${DB_PASSWORD:-aethermint_dev}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- aethermint-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U aethermint -d aethermint"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# --------------------------------------------------------------------------
# Redis - Cache and session store
# --------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: aethermint-redis
ports:
- "6379:6379"
command: >
redis-server
--appendonly yes
--requirepass ${REDIS_PASSWORD:-}
volumes:
- redis_data:/data
networks:
- aethermint-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# --------------------------------------------------------------------------
# MongoDB - Document store (optional, for certain services)
# --------------------------------------------------------------------------
mongodb:
image: mongo:7
container_name: aethermint-mongodb
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=aethermint
volumes:
- mongo_data:/data/db
networks:
- aethermint-network
restart: unless-stopped
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# =============================================================================
# Networks
# =============================================================================
networks:
aethermint-network:
name: aethermint-network
driver: bridge
# =============================================================================
# Volumes
# =============================================================================
volumes:
postgres_data:
name: aethermint-postgres-data
redis_data:
name: aethermint-redis-data
mongo_data:
name: aethermint-mongo-data