-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (50 loc) · 1.33 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
version: "3.3"
services:
db:
container_name: easy-spring-db-postgres
image: postgres:13.1-alpine
environment:
- POSTGRES_DB=easy-spring-db-postgres
- POSTGRES_USER=compose-postgres
- POSTGRES_PASSWORD=compose-postgres
ports:
- "5432:5432"
volumes:
- postgres_data_easy:/var/lib/postgresql/data
# 서비스 명
pgadmin:
# 사용할 이미지
image: dpage/pgadmin4
# 컨테이너 실행 시 재시작
restart: always
# 컨테이너명 설정
container_name: easy-pgadmin4
# 접근 포트 설정 (컨테이너 외부:컨테이너 내부)
ports:
- "5050:80"
# 환경 변수 설정
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: password
depends_on:
- db
spring:
container_name: spring-boot-easy
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://easy-spring-db-postgres:5432/easy-spring-db-postgres
SPRING_DATASOURCE_USERNAME: compose-postgres
SPRING_DATASOURCE_PASSWORD: compose-postgres
volumes:
- spring_data_easy:/spring/data
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
postgres_data_easy:
spring_data_easy: