-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·134 lines (134 loc) · 4.02 KB
/
docker-compose.yml
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
version: "3.9"
services:
web-app: # Internal port is 8081
build: web-app
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-app.rule=PathPrefix(`/`)"
- "traefik.http.services.web-app.loadbalancer.server.port=8081"
backend-server:
build: backend-server
depends_on:
- postgres
# ports:
# - '8686:8686'
environment:
REST_PORT: 8080
JWT_ISSUER: ${JWT_ISSUER}
JWT_HMAC512_SECRET_KEY: ${JWT_SECRET_KEY}
JWT_MAX_AGE_MS: ${JWT_MAX_AGE_MS}
PASSWORD_SALT: ${PASSWORD_SALT}
POSTGRESQL_HOST: postgres
POSTGRESQL_PORT: 5432
POSTGRESQL_USER: ${POSTGRES_USER}
POSTGRESQL_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRESQL_DB: ${POSTGRES_DB}
MONGO_HOST: mongodb
MONGO_USER: ${MONGO_USER}
MONGO_PASSWORD: ${MONGO_PASSWORD}
S3_ENDPOINT: http://file-storage:9000
S3_USER: ${S3_USER}
S3_PASSWORD: ${S3_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_TOPIC: cloud-management-tool
JAVA_OPTS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8686
deploy:
replicas: 2
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend-server.rule=PathPrefix(`/api/v1.0`)"
- "traefik.http.services.backend-server.loadbalancer.server.port=8080"
postgres:
image: postgres:13.3-alpine
restart: always
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
redis:
image: redis
restart: always
mongodb: # For encrypted text documents to allow update only one line
image: mongo:4.4
restart: always
volumes:
- mongodb:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
adminer: # Provides easy to use web interface to manage databases
image: adminer:4
restart: always
environment:
ADMINER_DEFAULT_SERVER: postgres
ports:
- "${ADMINER_PORT}:8080"
file-storage: # Minio is a S3 compatible file storage (https://docs.min.io/docs/deploy-minio-on-docker-compose.html)
image: minio/minio
restart: always
command: server /data
environment:
MINIO_ROOT_USER: ${S3_USER}
MINIO_ROOT_PASSWORD: ${S3_PASSWORD}
expose:
- 9000
volumes:
- s3:/data
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
deploy:
mode: global
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
prometheus: # Provides easy to use web interface to manage mongodb
image: prom/prometheus:v2.26.0
volumes:
- ./docker-compose/prometheus/:/etc/prometheus/:z # Config files
- prometheus:/prometheus # Database volume
- "/var/run/docker.sock:/var/run/docker.sock:ro"
user: root
privileged: true # Required for usage in podman
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
depends_on:
- backend-server
grafana: # Use http://prometheus:9090 as connect url for data source
image: grafana/grafana:7.5.3
ports:
- '${GRAFANA_PORT}:3000'
depends_on:
- prometheus
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_USERNAME}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
traefik: # https://hub.docker.com/_/traefik/
image: traefik:v2.4.8
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web-app.address=:80"
privileged: true # Required for usage in podman
depends_on:
- backend-server
- web-app
ports:
- '80:80'
- '8092:8080' # Dashboard: http://localhost:8082
volumes:
postgres:
mongodb:
s3:
prometheus: