-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (44 loc) · 1.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (44 loc) · 1.36 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
version: '3.8'
services:
diary_app:
build:
context: .
dockerfile: Dockerfile # Dockerfile 경로가 다를 경우 수정
volumes:
- static_volume:/app/staticfiles # static 파일 볼륨
- media_volume:/app/staticfiles # media 파일 볼륨 (필요시)
ports:
- "18000:8000"
env_file:
- resources/envs/.env # 환경 변수 파일 설정
nginx:
image: nginx:latest
container_name: nginx_container
ports:
- "80:80"
- "443:443"
volumes:
- ./resources/nginx/nginx.conf:/etc/nginx/nginx.conf:ro # Nginx 기본 설정 파일 매핑
- static_volume:/app/staticfiles:ro # 읽기 전용 설정
- media_volume:/app/staticfiles:ro # 읽기 전용 설정
- ./resources/ssl/localhost.pem:/etc/nginx/ssl/localhost.pem:ro # 읽기 전용 설정
- ./resources/ssl/localhost-key.pem:/etc/nginx/ssl/localhost-key.pem:ro # 읽기 전용 설정
environment:
SERVER_NAME: diary_app # diary_app 서비스 이름으로 지정
SERVER_PORT: 8000 # Django Gunicorn 포트 설정
depends_on:
- diary_app
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
restart: always # 자동 재시작 설정
redis:
image: redis:latest
ports:
- "6379:6379"
volumes:
db_data:
static_volume:
media_volume: