-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (44 loc) · 1.46 KB
/
docker-compose.yml
File metadata and controls
49 lines (44 loc) · 1.46 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
version: "3.8"
services:
redis:
image: redis:7-alpine # Redis 공식 경량 이미지
container_name: redis
restart: always # 자동 재시작
networks:
- verbly-net # 내부 네트워크(컨테이너끼리 통신)
spring:
image: yunnij/verbly:latest # Docker Hub에 푸시한 Spring 이미지 (앞에는 username)
container_name: spring
restart: always
env_file:
- .env
depends_on:
- redis # redis 먼저 뜬 뒤 spring 실행
networks:
- verbly-net # nginx/redis와 같은 네트워크로 묶음
nginx:
image: nginx:1.27-alpine # Nginx 공식 이미지
container_name: nginx # 컨테이너 이름
restart: always # 서버 재부팅/장애 시 자동 재시작
ports:
- "80:80" # EC2 80 → nginx 컨테이너 80
- "443:443"
volumes:
- /home/ubuntu/data/nginx:/etc/nginx/conf.d:ro # nginx 설정 파일 마운트(읽기 전용)
- /etc/letsencrypt:/etc/letsencrypt:ro # ssl 인증서
- /home/ubuntu/data/certbot/www:/var/www/certbot:ro
depends_on:
- spring # spring 뜬 뒤 nginx 실행
networks:
- verbly-net
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /home/ubuntu/data/certbot/www:/var/www/certbot
networks:
- verbly-net
networks:
verbly-net:
driver: bridge # 같은 네트워크끼리 DNS로 통신