-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose.yml
123 lines (115 loc) · 3.39 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
122
123
version: '2'
services:
#RabbitMQ broker, for Celery
rabbit:
hostname: rabbit
image: rabbitmq:3.7.3
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
#Flower UI for Celery queue
ui:
build: ./celery-ib
command: flower -A worker --port=5555 --broker=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit
environment:
- BROKER=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit
volumes:
- ./worker:/worker
- ./ibapi:/ibapi
ports:
- "127.0.0.1:5010:5555"
links:
- rabbit
depends_on:
- rabbit
#Python Celery worker
worker-1:
build: ./celery-ib
command: celery -A worker worker --loglevel=info -Ofair --concurrency=1
environment:
- BROKER=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit
- ECHEANCE_CAC40=${ECHEANCE_CAC40}
- ECHEANCE_DAX=${ECHEANCE_DAX}
- ECHEANCE_EUROSTOXX=${ECHEANCE_EUROSTOXX}
- ECHEANCE_FTSEMIB=${ECHEANCE_FTSEMIB}
volumes:
- ./worker:/worker
- ./ibapi:/ibapi
- ./logs:/logs
links:
- tws:tws
#Celery beat, to schedule periodic tasks
beat:
build: ./celery-ib
command: celery -A worker beat --loglevel=info
environment:
- BROKER=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit
links:
- rabbit
depends_on:
- postgres
- rabbit
volumes:
- ./worker:/worker
- ./ibapi:/ibapi
#Interactive Broker containerized API
tws:
build: ./ib-docker
ports:
- "127.0.0.1:4003:4003"
- "127.0.0.1:5900:5900"
volumes:
- ./ib-docker/IBController.ini:/opt/IBController/IBController.ini
- ./ib-docker/jts.ini:/root/Jts/jts.ini
environment:
- TZ=France/Paris
# Variables pulled from /IBController/IBControllerGatewayStart.sh
# Normally this script sets those environment variables and then launches DisplayBannerAndLaunch.sh.
# But now it's our runscript.sh that launches DisplayBannerAndLaunch.sh, so we set ourselves the environment variables
- VNC_PASSWORD=password
- TWS_MAJOR_VRSN=974
- IBC_INI=/opt/IBController/IBController.ini
- TRADING_MODE=paper
- IBC_PATH=/opt/IBController
- TWS_PATH=/root/Jts
- TWS_CONFIG_PATH=/root/Jts
- LOG_PATH=/opt/IBController/Logs
- TWSUSERID=XXX
- TWSPASSWORD=XXX
- FIXUSERID=
- FIXPASSWORD=
- JAVA_PATH=
- APP=GATEWAY
#Database
postgres:
image: postgres:9.6
restart: always
environment:
POSTGRES_DB: ${PG_DATABASE}
POSTGRES_USER: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWORD}
volumes:
- ./pgdata:/var/lib/postgresql/data
- ./db:/init
#Database web client
pgweb:
image: sosedoff/pgweb
command: pgweb --readonly --bind=0.0.0.0 --listen=8081
ports: ["127.0.0.1:8080:8081"]
links:
- postgres:postgres
environment:
- DATABASE_URL=postgres://${PG_USER}:${PG_PASSWORD}@postgres:5432/${PG_DATABASE}?sslmode=disable
depends_on:
- postgres
#Grafana to explore and visualise data
grafana:
image: grafana/grafana:5.0.3
restart: always
ports:
- "127.0.0.1:7000:3000"
volumes:
- ./grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password