-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yaml
131 lines (131 loc) · 3.77 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
127
128
129
130
131
version: "2"
services:
app:
environment:
- APP_NAME=boilerplate
- APP_PORT=8080
- APP_GRPC_PORT=8082
- APP_GRPC_HTTP__ROUTE__PREFIX=/v1
- APP_REQUEST_TIMEOUT=500
- APP_REQUEST_MAX__CONN=30
- APP_REQUEST_MAX__VOL_THRESHOLD=20
- APP_REQUEST_MAX__SLEEP__WINDOW=5000
- APP_REQUEST_MAX__ERR_PER_THRESHOLD=50
- BUILD_ENV=development
- LOG_LEVEL=debug
- SENTRY_DSN=https://[email protected]/1305039
- SENTRY_LOG__LEVEL=error
- DATABASE_DRIVER=mysql
- DATABASE_DSN=root:root@tcp(db:3306)/boilerplate?charset=utf8&parseTime=True&loc=UTC&multiStatements=true
- DATABASE_AUTO__MIGRATE=on
# OpenTracing
- OPENTRACING_JAEGER_HOST=jaeger
- OPENTRACING_JAEGER_PORT=6831
# Health Check
- HEALTH__CHECK_GOROUTINE__THRESHOLD=100
# Producer & Consumer
## Broker Producer limitation
- MACHINERY_BROKER_RETRIES=2
- MACHINERY_BROKER_RETRY__DELAY=50
- MACHINERY_BROKER_TIMEOUT=100
- MACHINERY_BROKER_MAX_CONN=100
- MACHINERY_BROKER_VOL_THRESHOLD=20
- MACHINERY_BROKER_SLEEP__WINDOW=5000
- MACHINERY_BROKER_ERR_PER_THRESHOLD=50
## Other
- MACHINERY_BROKER__DSN=amqp://rabbitmq:rabbitmq@rabbit:5672
- MACHINERY_DEFAULT__QUEUE=boilerplate
- MACHINERY_RESULT__BACKEND__DSN=redis://redis:6379
- MACHINERY_EXCHANGE=boilerplate
- MACHINERY_EXCHANGE__TYPE=direct
# Producer
- MACHINERY_BINDING__KEY=boilerplate
# Consumer
- MACHINERY_CONSUMER_ENABLE=1
- MACHINERY_CONSUMER_TAG=default-01
- MACHINERY_CONSUMER_CONCURRENT__TASKS=10
- MACHINERY_CONSUMER_PREFETCH__COUNT=1
build:
dockerfile: Dockerfile.dev
context: .
args:
build_env: 'development'
app_port: 8080
app_grpc_port: 8082
sqlboiler_version: '4.4.0'
sqlboiler_null_version: '8.1.1'
protobuf_release_tag: '3.14.0'
grpc_gateway_version: '2.2.0'
app_cmd: 'grpc'
security_opt:
- seccomp:unconfined
volumes:
- ./src:/go/src/github.com/eldad87/go-boilerplate/src
- ./go.mod:/go/src/github.com/eldad87/go-boilerplate/go.mod
- ./go.sum:/go/src/github.com/eldad87/go-boilerplate/go.sum
- ./vendor:/go/src/github.com/eldad87/go-boilerplate/vendor_host
- ./src/config/development/sqlboiler.yaml:/go/src/github.com/eldad87/go-boilerplate/sqlboiler.yaml
- ./data/mod:/go/pkg/mod
ports:
- "8080:8080"
- "8082:8082"
depends_on:
- redis
- rabbit
- db
- jaeger
redis:
image: redis
expose:
- 6379
ports:
- "6379:6379"
volumes:
- ./data/redis:/data
entrypoint: redis-server --appendonly yes
restart: always
redis-commander:
image: rediscommander/redis-commander:latest
restart: always
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8083:8081"
links:
- redis
depends_on:
- redis
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5578"
- "16686:16686"
- "14268:14268"
db:
image: mysql:5.7
volumes:
- ./data/mysql:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: boilerplate
MYSQL_USER: user
MYSQL_PASSWORD: user
ports:
- "3306:3306"
rabbit:
image: "rabbitmq:3-management"
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "rabbitmq"
RABBITMQ_DEFAULT_PASS: "rabbitmq"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- "15672:15672"
- "5672:5672"
tty: true
volumes:
- ./data/rabbitmq:/var/lib/rabbitmq