-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathdocker-compose.yml
121 lines (121 loc) · 2.62 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
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
version: "3.3"
services:
# Go-Web main container
go_web:
container_name: go-web
build:
context: .
dockerfile: Dockerfile
image: ikdev/go-web
restart: unless-stopped
tty: true
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
working_dir: /app
volumes:
- goweb:/app/storage
- ./config.yml:/app/config.yml
ports:
- "8009:8005"
networks:
- goweb
# MySQL container
go_web_mysql:
container_name: "go_web_mysql"
image: "mysql:5.7.28"
restart: unless-stopped
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- mysql:/var/lib/mysql
ports:
- "3306:3306"
networks:
- goweb
# Redis container
go_web_redis:
container_name: "redis_queue"
command: ["redis-server", "--appendonly", "yes"]
restart: unless-stopped
image: "redis:latest"
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- goweb
# MongoDB container
go_web_mongo:
container_name: "mongo"
restart: unless-stopped
image: "mongo"
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
environment:
- MONGO_INITDB_DATABASE={MONGO_DATABASE}
ports:
- "27017:27017"
volumes:
- mongo:/data/db
networks:
- goweb
# Elasticsearch container
# This container was build just for development purpose.
# If you'd like to use Elastic in production environment
# check https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docker.html
go_web_elastic:
container_name: "elastic"
image: "elasticsearch:7.5.1"
restart: unless-stopped
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
environment:
- discovery.type=single-node
ports:
- "9200:9200"
networks:
- goweb
networks:
goweb:
volumes:
goweb:
driver: local
mysql:
driver: local
redis-data:
driver: local
mongo:
driver: local