-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (70 loc) · 2.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
76 lines (70 loc) · 2.27 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
# ==============================================================================
# Unified Monorepo Docker Orchestration
# Standard: ISO/IEC 12207 (Software Lifecycle & Environment Isolation)
# System: Maritime LoRa Mesh Network Simulator
# ==============================================================================
name: maritime-simulation-monorepo
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: maritime-simulation-backend:latest
restart: unless-stopped
ports:
- "${HTTP_PORT:-8080}:8080"
environment:
HTTP_ADDR: ":8080"
LOG_LEVEL: ${LOG_LEVEL:-info}
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_USER: ${POSTGRES_USER:-simulator}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-simulator}
POSTGRES_DB: ${POSTGRES_DB:-lora_simulator}
REDIS_ADDR: redis:6379
TOPOLOGY_INTERVAL_SECONDS: ${TOPOLOGY_INTERVAL_SECONDS:-5}
PING_MIN_INTERVAL_SECONDS: ${PING_MIN_INTERVAL_SECONDS:-3}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-*}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:8080}
NEXT_PUBLIC_WS_URL: ${NEXT_PUBLIC_WS_URL:-ws://localhost:8080/ws/monitor}
image: maritime-simulation-frontend:latest
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-3000}:3000"
depends_on:
- backend
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-simulator}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-simulator}
POSTGRES_DB: ${POSTGRES_DB:-lora_simulator}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-simulator} -d ${POSTGRES_DB:-lora_simulator}"]
interval: 5s
timeout: 3s
retries: 12
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--save", "", "--appendonly", "no"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 12
volumes:
pgdata: