-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (50 loc) · 1.13 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
version: '3.9' # 指定本 yml 依从的 compose 哪个版本制定的
services:
huango:
container_name: huango
image: zerodot618/huango:dev
# 指定为构建镜像(Dockerfile)上下文路径
build:
context: .
target: dev
# 将主机的数据卷或着文件挂载到容器里
volumes:
- .:/go/src/app
# 指定端口映射
ports:
- "3000:3000"
- "2345:2345"
networks:
- huango-network
huango-db:
container_name: huango-db
image: postgres
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
volumes:
- postgres-db:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- huango-network
huango-cache:
container_name: huango-cache
image: redis
environment:
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- redis-cache:/data
ports:
- "6379:6379"
networks:
- huango-network
volumes:
# 数据库 postgres 数据卷
postgres-db:
# redis 缓存数据卷
redis-cache:
networks:
huango-network:
name: huango-network