forked from StaZisS/KeyInfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
102 lines (95 loc) · 2.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
version: '3.8'
services:
postgres:
container_name: postgres
image: postgres:latest
restart: always
env_file:
- .env
ports:
- '5432:5432'
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "db_prod" ]
interval: 5s
timeout: 20s
retries: 5
volumes:
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
- postgres:/var/lib/postgresql/data
networks:
- my_network
liquibase:
image: liquibase/liquibase:latest
container_name: liquibase
env_file:
- .env
environment:
- port=5432
- host=postgres
- tmout=28800
depends_on:
postgres:
condition: service_healthy
volumes:
- ./backend/src/main/resources/db/changelog:/liquibase/changelog
- ./liquibase_policy_init.sh:/liquibase/liquibase_policy_init.sh:ro
entrypoint: ./liquibase_policy_init.sh
networks:
- my_network
redis:
container_name: redis
image: redis:latest
restart: always
ports:
- '6379:6379'
volumes:
- redis:/var/lib/redis/data
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
networks:
- my_network
key-info:
env_file:
- .env
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/${KEY_INFO_DB}
- SPRING_DATASOURCE_USERNAME=${POSTGRES_USER}
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD}
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
- REDIS_HOST=redis
- REDIS_PORT=6379
build:
dockerfile: Dockerfile
context: backend
network: host
args:
- DB_URL=jdbc:postgresql://localhost:5432/${KEY_INFO_DB}
- DB_USERNAME=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
ports:
- '8080:8080'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
liquibase:
condition: service_completed_successfully
networks:
- my_network
web:
build:
context: .
dockerfile: ./frontend/Dockerfile
ports:
- '3000:3000'
networks:
- my_network
volumes:
postgres:
driver: local
redis:
driver: local
networks:
my_network:
driver: bridge