forked from globocom/GloboNetworkAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
103 lines (96 loc) · 2.74 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
version: '3.3'
services:
db:
container_name: netapi_db
image: mysql:5.7
platform: linux/x86_64
command: --default-authentication-plugin=mysql_native_password
ports:
- "33306:3306"
environment:
MYSQL_ROOT_PASSWORD: 'put_your_password_here'
volumes:
- netapi_db_vol:/var/lib/mysql
networks:
- netapi_net
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1",-p$$MYSQL_ROOT_PASSWORD ,"--silent"]
interval: 5s
timeout: 3s
retries: 2
start_period: 15s
queue:
container_name: netapi_queue
image: rabbitmq:3.6.9
ports:
- "5672:5672"
- "15672:15672"
command: sh -c "rabbitmq-plugins enable rabbitmq_management; rabbitmq-server"
volumes:
- ./scripts/docker/rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
- ./scripts/docker/definitions.json:/etc/rabbitmq/definitions.json:ro
networks:
- netapi_net
cache:
container_name: netapi_cache
image: memcached:1.4.33
ports:
- "11211"
networks:
- netapi_net
celery:
container_name: netapi_celery
image: globocom/networkapi:latest
build:
context: .
dockerfile: ./scripts/docker/Dockerfile
restart: always
working_dir: /netapi
command: sh scripts/docker/docker-start-celery.sh
env_file:
- ./scripts/docker/netapi.env
volumes:
- ./networkapi/:/netapi/networkapi
networks:
- netapi_net
links:
- db:netapi_db
- queue:netapi_queue
- cache:netapi_cache
depends_on:
- queue
netapi:
container_name: netapi_app
image: globocom/networkapi:latest
build:
context: .
dockerfile: ./scripts/docker/Dockerfile
restart: always
working_dir: /netapi
command: sh /netapi/scripts/docker/docker-start-netapi.sh
ports:
- "8000:8000"
- "8001:8001"
env_file:
- ./scripts/docker/netapi.env
volumes:
- ./:/netapi/
- ./dev:/netapi/dev
# # COMMENT
# - /tftpboot:/tftpboot:rw
networks:
- netapi_net
depends_on:
db:
condition: service_healthy
links:
- db:netapi_db
external_links:
- netapi_graylog2
- cache:netapi_cache
- odl:netapi_odl
- queue:netapi_queue
volumes:
netapi_db_vol:
networks:
netapi_net: