-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
37 lines (37 loc) · 933 Bytes
/
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
# Step 1: Just define the database service
# services:
# db:
# image: postgres:latest
# restart: always
# ports:
# - 5433:5432
# environment:
# POSTGRES_DB: comic_book_store_db
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: password
# volumes:
# - db:/var/lib/postgresql/data
# volumes:
# db:
# Step 2: Add in the Flyway service
services:
db:
image: postgres:latest
restart: always
ports:
- 5433:5432
environment:
POSTGRES_DB: comic_book_store_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- db:/var/lib/postgresql/data
flyway:
image: flyway/flyway
command: -url=jdbc:postgresql://db/comic_book_store_db -schemas=public -user=postgres -password=password -connectRetries=5 migrate -validateMigrationNaming=true -X
volumes:
- ./database:/flyway/sql
depends_on:
- db
volumes:
db: