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