-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (62 loc) · 1.7 KB
/
docker-compose.yml
File metadata and controls
65 lines (62 loc) · 1.7 KB
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
64
65
services:
postgreSQL:
image: postgres:16
ports:
- "5432:5432"
env_file:
- .env
environment:
- TZ=Asia/Seoul
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- pbl-network
app:
image: imjuyongp/pbl:latest # 추후에 도커 허브에 저장할 이미지 계정이랑 이미지 이름 설정하기
restart: always
expose:
- "8080"
env_file:
- .env # 팀원들끼리만 공유
environment:
- SPRING_PROFILES_ACTIVE=prod # 서브모듈 환경변수 prod 버전 인식
- TZ=Asia/Seoul
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command:
- java -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} -jar app.jar
# 실행 명령어: jar 파일을 실행하면서 Spring 프로필 활성화
depends_on:
- postgreSQL # 이 서비스가 mysql이 먼저 실행된 후 시작되도록
networks:
- pbl-network # services 끼리는 같은 네트워크를 공유
nginx:
image: nginx:alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/certbot:/etc/letsencrypt
- ./nginx/www:/var/www/certbot
depends_on:
- app
networks:
- pbl-network
certbot:
image: certbot/certbot
volumes:
- ./nginx/certbot:/etc/letsencrypt
- ./nginx/www:/var/www/certbot
networks:
- pbl-network
networks:
pbl-network:
driver: bridge # Docker 기본 브리지 네트워크를 사용
volumes:
postgres-data: