-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yaml
126 lines (117 loc) · 2.82 KB
/
docker-compose.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.8'
networks:
app-net:
services:
postgresql:
image: postgres:16.2
container_name: postgresql
networks:
- app-net
restart: unless-stopped
environment:
POSTGRES_DB: go_blogger
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
volumes:
- ~/db/postgresql/data:/var/lib/postgresql/data
- ./service/user/rpc/model/user.sql:/docker-entrypoint-initdb.d/user.sql
- ./service/blog/rpc/model/blog.sql:/docker-entrypoint-initdb.d/blog.sql
- ./service/post/rpc/model/post.sql:/docker-entrypoint-initdb.d/post.sql
- ./service/page/rpc/model/page.sql:/docker-entrypoint-initdb.d/page.sql
- ./service/comment/rpc/model/comment.sql:/docker-entrypoint-initdb.d/comment.sql
ports:
- "5432:5432"
redis:
image: redis:7.2.4
container_name: redis
networks:
- app-net
restart: unless-stopped
ports:
- "6379:6379"
user-service:
build:
context: .
dockerfile: ./docker/user.Dockerfile
container_name: user-service
networks:
- app-net
restart: unless-stopped
ports:
- "10000:10000"
depends_on:
- postgresql
- redis
- etcd-single
blog-service:
build:
context: .
dockerfile: ./docker/blog.Dockerfile
container_name: blog-service
networks:
- app-net
restart: unless-stopped
ports:
- "10001:10001"
depends_on:
- postgresql
- redis
- etcd-single
post-service:
build:
context: .
dockerfile: ./docker/post.Dockerfile
container_name: post-service
networks:
- app-net
restart: unless-stopped
ports:
- "10002:10002"
depends_on:
- postgresql
- redis
- etcd-single
page-service:
build:
context: .
dockerfile: ./docker/page.Dockerfile
container_name: page-service
networks:
- app-net
restart: unless-stopped
ports:
- "10003:10003"
depends_on:
- postgresql
- redis
- etcd-single
comment-service:
build:
context: .
dockerfile: ./docker/comment.Dockerfile
container_name: comment-service
networks:
- app-net
restart: unless-stopped
ports:
- "10004:10004"
depends_on:
- postgresql
- redis
- etcd-single
etcd-single:
image: quay.io/coreos/etcd:v3.5.12
container_name: etcd-single
networks:
- app-net
restart: unless-stopped
entrypoint: ["/usr/local/bin/etcd", "--config-file", "/etcd/single/conf/etcd.yaml"]
ports:
- "2379:2379"
- "2380:2380"
environment:
ETCDCTL_API: 3
volumes:
- type: bind
source: $HOME/db/etcd/single/
target: /etcd/single/