-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
117 lines (110 loc) · 3.25 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
version: '3'
volumes:
pg-data:
prometheus-data:
grafana-data:
services:
db:
build:
context: .
dockerfile: env/postgres/pg.Dockerfile
hostname: readme-app-db
container_name: postgres
volumes:
- pg-data:/var/lib/postgresql/data
expose:
- 5432
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=$SPRING_DATASOURCE_PASSWORD
- POSTGRES_USER=$SPRING_DATASOURCE_USERNAME
- POSTGRES_DB=$DBNAME
- PGDATA=/var/lib/postgresql/data/pg-data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
restart: always
app:
image: 'webcane/readme-app-spring:latest'
hostname: readme-app-api
container_name: spring
build:
context: .
expose:
- 8080
- 5005
ports:
- "8080:8080" #api
- "5005:5005" #debug
restart: always
environment:
- HOST=db
- SPRING_JPA_HIBERNATE_DDL_AUTO=create
- APP_AUTH_TOKEN_SECRET=$APP_AUTH_TOKEN_SECRET
- APP_AUTH_TOKEN_SUBJECT=$APP_AUTH_TOKEN_SUBJECT
- APP_AUTH_TOKEN_AUDIENCE=$APP_AUTH_TOKEN_AUDIENCE
- APP_AUTH_TOKEN_EXPIRATION=$APP_AUTH_TOKEN_EXPIRATION
- APP_OAUTH2_AUTHORIZED_REDIRECT_URI=$APP_OAUTH2_AUTHORIZED_REDIRECT_URI
- SPRING_PROFILES_ACTIVE=$SPRING_PROFILES_ACTIVE
- SPRING_DATASOURCE_USERNAME=$SPRING_DATASOURCE_USERNAME
- SPRING_DATASOURCE_PASSWORD=$SPRING_DATASOURCE_PASSWORD
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID=$SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET=$SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET
- MANAGEMENT_METRICS_TAGS_APPLICATION=$MANAGEMENT_METRICS_TAGS_APPLICATION
- LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_WEB_SERVLET_MVC_METHOD_ANNOTATION=INFO
- LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_BOOT_ACTUATE_ENDPOINT_WEB_SERVLET=INFO
#env_file:
# - .env
depends_on:
- db
ui:
image: 'webcane/readme-app-angular:latest'
hostname: readme-app-ui
container_name: angular
build:
context: ./angular
args:
BUILD_CMD: build
expose:
- "80"
ports:
- "4200:80"
restart: always
volumes:
- type: bind
source: ./angular/src/assets/config/envConfig.json
target: /assets/config/envConfig.json
depends_on:
- app
prometheus:
image: 'prom/prometheus'
hostname: readme-app-prometheus
container_name: prometheus
restart: unless-stopped
volumes:
- ./env/prometheus:/etc/prometheus
- prometheus-data:/prometheus
ports:
- "9090:9090"
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "9090" ]
grafana:
image: 'grafana/grafana:9.0.4'
hostname: readme-app-grafana
container_name: grafana
volumes:
- ./env/grafana/provisioning:/etc/grafana/provisioning
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
restart: unless-stopped
env_file:
- ./env/grafana/grafana.env
depends_on:
- prometheus
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "3000" ]