forked from Project-Books/books-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
38 lines (36 loc) · 944 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
38
version: '3.9'
services:
db:
image: postgres:14 # 14 is the latest Flyway supported version
container_name: books_api_db
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- "5432:5432"
booksapi:
image: booksapi
container_name: books_api
build:
context: .
dockerfile: ./Dockerfile
args:
mvn_arg: clean package
PROFILE: ${PROFILE}
DB_HOSTNAME: db
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
environment:
- POSTGRES_DATABASE=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_HOSTNAME=db
- POSTGRES_PORT=${DB_PORT}
ports:
- "8082:8082"
depends_on:
- db