-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-fullstack.yml
145 lines (137 loc) · 4.08 KB
/
docker-compose-fullstack.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
135
136
137
138
139
140
141
142
143
144
145
# Docker Compose for entire Full Stack Application running on localhost with Containers pulled from dockerhub/philkes
version: '3.3'
services:
# App backend service
movieland-backend:
container_name: movieland-backend
image: philkes/movie-land-backend:master
ports:
- "8080:8080"
# depends_on:
# - movieland-db
environment: # Pass environment variables to the service
SPRING_DATASOURCE_URL: jdbc:postgresql://movieland-db:5432/movieland_db?useLegacyDatetimeCode=false&serverTimezone=Europe/Berlin
SPRING_DATASOURCE_USERNAME: movielandadmin
SPRING_DATASOURCE_PASSWORD: movielandadmin
SPRING_BOOT_ADMIN_CLIENT_URL: http://movieland-spring-admin:8081
ZIPKIN_ENABLED: true
ZIPKIN_SERVER: movieland-tempo:9411
LOKI_ENABLED: true
LOKI_SERVER: movieland-loki:3100
PORT: 8080
networks:
- backend
- frontend
# Frontend Service
movieland-frontend:
container_name: movieland-frontend
image: philkes/movie-land-frontend:master
ports:
- "4000:4000"
depends_on:
- movieland-backend
environment: # Pass environment variables to the service
REST_API_URL: http://movieland-backend:8080/api
PORT: 4000
networks:
- frontend
# Database Service (Postgresql)
# movieland-db:
# container_name: movieland-db
# image: 'postgres:13.1-alpine'
# ports:
# - "5432:5432"
# environment:
# - POSTGRES_USER=movielandadmin
# - POSTGRES_PASSWORD=movielandadmin
# - POSTGRES_DB=movieland_db
# volumes:
# - db-data:/var/lib/postgresql/data
# networks:
# - backend
# App backend service
movieland-spring-admin:
container_name: movieland-spring-admin
image: philkes/movie-land-spring-admin:master
ports:
- "8081:8081"
environment:
PORT: 8081
networks:
- backend
movieland-prometheus:
image: prom/prometheus:v2.41.0
container_name: prometheus
restart: unless-stopped
volumes:
- ./monitoring/prometheus/prometheus-docker.yml:/etc/prometheus/prometheus-docker.yml
ports:
- "9090:9090"
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "9090" ]
networks:
- backend
movieland-promtail:
image: grafana/promtail:2.7.1
container_name: promtail
volumes:
- ./monitoring/promtail/promtail-docker.yml:/etc/promtail/promtail.yml
command: -config.file=/etc/promtail/promtail.yml
networks:
- backend
# Source: https://github.com/marcingrzejszczak/observability-boot-blog-post
movieland-tempo:
container_name: tempo
image: grafana/tempo:1.5.0
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./monitoring/tempo/tempo-local.yaml:/etc/tempo.yaml:ro
- tempo-data:/tmp/tempo
ports:
- "14268" # jaeger ingest
- "9411:9411" # zipkin
networks:
- backend
movieland-loki:
container_name: loki
image: grafana/loki:2.7.1
command: [ "-config.file=/etc/loki/local-config.yaml" ]
ports:
- "3100:3100" # loki needs to be exposed so it receives logs
environment:
- JAEGER_AGENT_HOST=tempo
- JAEGER_ENDPOINT=http://localhost:14268/api/traces # send traces to Tempo
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
networks:
- backend
movieland-grafana:
image: grafana/grafana:9.3.2
container_name: grafana
restart: unless-stopped
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
PROMETHEUS_SERVER: http://movieland-prometheus:9090
TEMPO_SERVER: http://movieland-tempo:3200
LOKI_SERVER: http://movieland-loki:3100
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
depends_on:
- movieland-prometheus
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "3000" ]
user: "1000"
networks:
- backend
# Volumes
volumes:
db-data:
tempo-data:
prom-data:
# Networks to be created to facilitate communication between containers
networks:
backend:
frontend: