forked from hummingbot/hummingbot-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (88 loc) · 2.66 KB
/
docker-compose.yml
File metadata and controls
90 lines (88 loc) · 2.66 KB
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
services:
hummingbot-api:
container_name: hummingbot-api
image: hummingbot/hummingbot-api:latest
ports:
- "8000:8000"
volumes:
- ./bots:/hummingbot-api/bots
- /var/run/docker.sock:/var/run/docker.sock
env_file:
- .env
environment:
# Override specific values for Docker networking
- BROKER_HOST=emqx
- DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@postgres:5432/hummingbot_api
- GATEWAY_URL=http://host.docker.internal:15888
extra_hosts:
# Map host.docker.internal to host gateway for Linux compatibility
# On macOS/Windows, Docker Desktop provides this automatically
# On Linux, this maps to the docker bridge gateway IP
- "host.docker.internal:host-gateway"
networks:
- emqx-bridge
depends_on:
- postgres
emqx:
container_name: hummingbot-broker
image: emqx:5
restart: unless-stopped
environment:
- EMQX_NAME=emqx
- EMQX_HOST=node1.emqx.local
- EMQX_CLUSTER__DISCOVERY_STRATEGY=static
- EMQX_CLUSTER__STATIC__SEEDS=[emqx@node1.emqx.local]
- EMQX_LOADED_PLUGINS="emqx_recon,emqx_retainer,emqx_management,emqx_dashboard"
volumes:
- emqx-data:/opt/emqx/data
- emqx-log:/opt/emqx/log
- emqx-etc:/opt/emqx/etc
ports:
- "1883:1883" # mqtt:tcp
- "8883:8883" # mqtt:tcp:ssl
- "8083:8083" # mqtt:ws
- "8084:8084" # mqtt:ws:ssl
- "8081:8081" # http:management
- "18083:18083" # http:dashboard
- "61613:61613" # web-stomp gateway
networks:
emqx-bridge:
aliases:
- node1.emqx.local
healthcheck:
test: [ "CMD", "/opt/emqx/bin/emqx_ctl", "status" ]
interval: 5s
timeout: 25s
retries: 5
postgres:
container_name: hummingbot-postgres
image: postgres:16
restart: unless-stopped
environment:
# These variables automatically create the user and database on first initialization
- POSTGRES_DB=hummingbot_api
- POSTGRES_USER=hbot
- POSTGRES_PASSWORD=hummingbot-api
# Additional init parameters for better compatibility
- POSTGRES_INITDB_ARGS=--encoding=UTF8
volumes:
- postgres-data:/var/lib/postgresql/data
# Init script as safety net - only runs on first initialization
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
ports:
- "5432:5432"
networks:
- emqx-bridge
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hbot -d hummingbot_api"]
interval: 10s
timeout: 5s
retries: 5
networks:
emqx-bridge:
driver: bridge
volumes:
emqx-data: { }
emqx-log: { }
emqx-etc: { }
postgres-data: { }