-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (81 loc) · 1.96 KB
/
Copy pathdocker-compose.yml
File metadata and controls
88 lines (81 loc) · 1.96 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
version: "3.8"
services:
postgres:
image: postgres:latest
container_name: blogv2-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: BlogV2Testing
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d BlogV2Testing" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5433:5432"
networks:
- blogv2-network
volumes:
- blogv2-postgres-data:/var/lib/postgresql
redis-cache:
container_name: blogv2-redis
image: redis:7-alpine
ports:
- "6399:6379"
networks:
- blogv2-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 5
app:
build: .
image: blogv2-image:latest
container_name: blogv2-app
ports:
- "9080:8092"
depends_on:
postgres:
condition: service_healthy
redis-cache:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/BlogV2Testing
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
SPRING_DATA_REDIS_HOST: redis-cache
SPRING_DATA_REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET}
IMAGEKIT_PUBLIC_KEY: ${IMAGEKIT_PUBLIC}
IMAGEKIT_PRIVATE_KEY: ${IMAGEKIT_PRIVATE}
IMAGEKIT_URL_ENDPOINT: ${IMAGEKIT_URL}
networks:
- blogv2-network
prometheus:
image: prom/prometheus:latest
container_name: blogv2-prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- blogv2-network
depends_on:
- app
grafana:
image: grafana/grafana:latest
container_name: blogv2-grafana
ports:
- "3000:3000"
networks:
- blogv2-network
depends_on:
- prometheus
networks:
blogv2-network:
driver: bridge
volumes:
blogv2-postgres-data: