-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
61 lines (50 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
61 lines (50 loc) · 1.33 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
version: '3.8'
services:
redis:
image: redis:latest
container_name: journey-redis
expose:
- "6379"
restart: unless-stopped
spring-app:
ports:
- "8080:8080"
image: ashtonsw/mydockerrepo:latest
container_name: spring-app
expose:
- "8080"
env_file:
- .env
environment:
# MySQL RDS 연결 정보
SPRING_DATASOURCE_URL: jdbc:mysql://mydb.cdmkas62q1dg.ap-northeast-2.rds.amazonaws.com:3306/mydb
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
# Redis 정보 (EC2 내부 설치)
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
depends_on:
- redis
restart: unless-stopped # 컨테이너 재시작 정책
nginx:
image: nginx:latest
container_name: nginx
# Nginx만 호스트로 80,443 노출
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt:ro
- ./data/certbot/www:/var/www/certbot
depends_on:
- spring-app
- certbot
restart: unless-stopped
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
restart: unless-stopped