-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (39 loc) · 1.02 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
version: '3.9'
services:
database:
image: postgres
environment:
POSTGRES_URL: "jdbc:postgresql://localhost:5432/customer-db"
POSTGRES_DB: "customer-db"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "123456"
ports:
- "5432:5432"
volumes:
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres-data:/var/lib/postgresql/data
networks:
- postgres-network
flyway:
image: flyway/flyway:10.21-alpine
command: -url=jdbc:postgresql://database:5432/customer-db -schemas=public -user=postgres -password=123456 -connectRetries=60 migrate
volumes:
- $PWD/src/main/resources/db/migration:/flyway/sql
depends_on:
- database
networks:
- postgres-network
api:
depends_on:
- database
build: .
environment:
DB_URL: "jdbc:postgresql://database:5432/customer-db"
SPRING_PROFILES_ACTIVE: "dev"
ports:
- "8080:8080"
networks:
- postgres-network
networks:
postgres-network:
driver: bridge