-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (62 loc) · 1.58 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
64
65
66
67
68
69
version: '3.8'
services:
backend:
image: mona233/appleblog_backend:latest
container_name: backend
ports:
- "8000:8000"
networks:
- appleblog_network
environment:
- DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1,backend,SERVER_NAME
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pYrdip-kevset-mihby2
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- REDIS_HOST=redis # Redis 容器名称
- REDIS_PORT=6379 # Redis 内部端口
depends_on:
- db
- redis # 添加对 redis 的依赖
volumes:
- ./media/post_images:/app/media/post_images
web:
image: mona233/appleblog_web:latest
container_name: web
ports:
- "3000:3000"
depends_on:
- backend
networks:
- appleblog_network
environment:
- API_URL=http://backend:8000/api/posts/
- WEBCONFIG_API_URL=http://backend:8000/api/web_config
db:
image: postgres:latest
container_name: db
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pYrdip-kevset-mihby2
volumes:
- ./postgres_data:/var/lib/postgresql/data
networks:
- appleblog_network
redis:
image: redis:latest # 使用官方 Redis 镜像
container_name: redis
networks:
- appleblog_network
watchtower:
image: containrrr/watchtower
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 60 backend web
networks:
appleblog_network:
driver: bridge
volumes:
postgres_data: