-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (46 loc) · 1.15 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
version: '3.9'
services:
db:
image: postgres
container_name: postgres_hotel_california_api
restart: always
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DATABASE}
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data # Persist data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql # Execute SQL script
networks:
- network-hotel-california
adminer:
image: adminer
container_name: pg_admin_hotel_california_api
restart: always
ports:
- 8081:8080
networks:
- network-hotel-california
hotel-california-api:
build: .
image: fernandesrh/hotel-california-api
container_name: hotel-california-api-brigde
restart: always
command: mvn spring-boot:run
ports:
- 8080:8080
depends_on:
- db
networks:
- network-hotel-california
environment:
- SPRING_DATASOURCE_URL=${DB_URL}
- SPRING_DATASOURCE_USERNAME=${DB_USER}
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWORD}
volumes:
postgres_data:
networks:
network-hotel-california:
driver: bridge