-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
83 lines (78 loc) · 1.74 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
83 lines (78 loc) · 1.74 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
services:
postgres:
image: 'postgres:latest'
container_name: postgres_db
environment:
- 'POSTGRES_DB=mydatabase'
- 'POSTGRES_PASSWORD=secret'
- 'POSTGRES_USER=myuser'
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql
- shared_volume:/shared
networks:
- app_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myuser -d mydatabase"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
redis:
image: 'redis:latest'
container_name: redis_cache
ports:
- '6379:6379'
volumes:
- redis_data:/data
- shared_volume:/shared
networks:
- app_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
devcalc-api:
image: 'shyuu7/devcalc-api:latest'
container_name: devcalc_app
ports:
- '8080:8080'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- shared_volume:/app/shared
networks:
- app_network
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/mydatabase
- SPRING_DATASOURCE_USERNAME=myuser
- SPRING_DATASOURCE_PASSWORD=secret
- SPRING_REDIS_HOST=redis
- SPRING_REDIS_PORT=6379
test_container:
image: busybox
container_name: connectivity_test
command: sleep 3600
volumes:
- shared_volume:/shared
networks:
- app_network
depends_on:
- postgres
- redis
volumes:
postgres_data:
driver: local
redis_data:
driver: local
shared_volume:
driver: local
networks:
app_network:
driver: bridge