-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (133 loc) · 3.62 KB
/
docker-compose.yml
File metadata and controls
140 lines (133 loc) · 3.62 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
services:
backend:
build:
context: .
dockerfile: docker/Dockerfile.backend
image: edgar4j-backend:latest
ports:
- "${BACKEND_PORT:-8080}:8080"
environment:
SPRING_PROFILES_ACTIVE: docker
EDGAR4J_RESOURCE_MODE: high
SEC_USER_AGENT: ${SEC_USER_AGENT:-Edgar4J/1.0 (ops@example.com)}
SPRING_CLOUD_CONFIG_ENABLED: "false"
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/edgar4j
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-edgar4j}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-edgar4j}
SPRING_MONGODB_URI: mongodb://mongodb:27017/edgar
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
EDGAR4J_SECURITY_ENABLED: ${EDGAR4J_SECURITY_ENABLED:-false}
EDGAR4J_SECURITY_USERNAME: ${EDGAR4J_SECURITY_USERNAME:-}
EDGAR4J_SECURITY_PASSWORD: ${EDGAR4J_SECURITY_PASSWORD:-}
volumes:
- edgar4j-data:/app/data
depends_on:
mongodb:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_started
profiles:
- high
backend-low:
build:
context: .
dockerfile: docker/Dockerfile.backend
image: edgar4j-backend:latest
ports:
- "${BACKEND_PORT:-8080}:8080"
environment:
SPRING_PROFILES_ACTIVE: docker
EDGAR4J_RESOURCE_MODE: low
SEC_USER_AGENT: ${SEC_USER_AGENT:-Edgar4J/1.0 (ops@example.com)}
SPRING_CLOUD_CONFIG_ENABLED: "false"
EDGAR4J_SECURITY_ENABLED: ${EDGAR4J_SECURITY_ENABLED:-false}
EDGAR4J_SECURITY_USERNAME: ${EDGAR4J_SECURITY_USERNAME:-}
EDGAR4J_SECURITY_PASSWORD: ${EDGAR4J_SECURITY_PASSWORD:-}
volumes:
- edgar4j-data:/app/data
networks:
default:
aliases:
- backend
profiles:
- low
frontend:
build:
context: .
dockerfile: docker/Dockerfile.frontend
args:
VITE_API_URL: ${PUBLIC_API_URL:-http://localhost:${FRONTEND_PORT:-3000}}
image: edgar4j-frontend:latest
ports:
- "${FRONTEND_PORT:-3000}:8080"
depends_on:
backend:
condition: service_healthy
profiles:
- high
frontend-low:
build:
context: .
dockerfile: docker/Dockerfile.frontend
args:
VITE_API_URL: ${PUBLIC_API_URL:-http://localhost:${FRONTEND_PORT:-3000}}
image: edgar4j-frontend:latest
ports:
- "${FRONTEND_PORT:-3000}:8080"
depends_on:
backend-low:
condition: service_healthy
profiles:
- low
mongodb:
image: mongo:7
ports:
- "${MONGODB_PORT:-27017}:27017"
volumes:
- mongo-data:/data/db
- ./docker/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- high
postgres:
image: postgres:16
environment:
POSTGRES_DB: ${POSTGRES_DB:-edgar4j}
POSTGRES_USER: ${POSTGRES_USER:-edgar4j}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-edgar4j}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pg-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-edgar4j}"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- high
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- high
volumes:
edgar4j-data:
mongo-data:
pg-data:
redis-data: