diff --git a/docker-compose-dydx.yml b/docker-compose-dydx.yml index df2c4ec..298bc5b 100644 --- a/docker-compose-dydx.yml +++ b/docker-compose-dydx.yml @@ -6,7 +6,7 @@ services: - "8501:8501" environment: - AUTH_SYSTEM_ENABLED=False - - BACKEND_API_HOST=backend-api + - BACKEND_API_HOST=hummingbot-api - BACKEND_API_PORT=8000 - BACKEND_API_USERNAME=admin - BACKEND_API_PASSWORD=admin @@ -15,23 +15,24 @@ services: - ./pages:/home/dashboard/frontend/pages networks: - emqx-bridge - backend-api: - container_name: backend-api - image: hummingbot/backend-api:dydx + hummingbot-api: + container_name: hummingbot-api + image: hummingbot/hummingbot-api:dydx ports: - "8000:8000" volumes: - - ./bots:/backend-api/bots + - ./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 - - BROKER_PORT=1883 - - USERNAME=admin - - PASSWORD=admin + - DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@postgres:5432/hummingbot_api networks: - emqx-bridge + depends_on: + - postgres emqx: container_name: hummingbot-broker image: emqx:5 @@ -64,6 +65,30 @@ services: timeout: 25s retries: 5 +networks: + emqx-bridge: + driver: bridge + + postgres: + container_name: hummingbot-postgres + image: postgres:15 + restart: unless-stopped + environment: + - POSTGRES_DB=hummingbot_api + - POSTGRES_USER=hbot + - POSTGRES_PASSWORD=hummingbot-api + volumes: + - postgres-data:/var/lib/postgresql/data + 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 @@ -72,3 +97,4 @@ volumes: emqx-data: { } emqx-log: { } emqx-etc: { } + postgres-data: { } diff --git a/docker-compose.yml b/docker-compose.yml index ff78587..b979ac0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: - "8501:8501" environment: - AUTH_SYSTEM_ENABLED=False - - BACKEND_API_HOST=backend-api + - BACKEND_API_HOST=hummingbot-api - BACKEND_API_PORT=8000 - BACKEND_API_USERNAME=admin - BACKEND_API_PASSWORD=admin @@ -15,23 +15,24 @@ services: - ./pages:/home/dashboard/frontend/pages networks: - emqx-bridge - backend-api: - container_name: backend-api - image: hummingbot/backend-api:latest + hummingbot-api: + container_name: hummingbot-api + image: hummingbot/hummingbot-api:latest ports: - "8000:8000" volumes: - - ./bots:/backend-api/bots + - ./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 - - BROKER_PORT=1883 - - USERNAME=admin - - PASSWORD=admin + - DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@postgres:5432/hummingbot_api networks: - emqx-bridge + depends_on: + - postgres emqx: container_name: hummingbot-broker image: emqx:5 @@ -64,6 +65,26 @@ services: timeout: 25s retries: 5 + postgres: + container_name: hummingbot-postgres + image: postgres:15 + restart: unless-stopped + environment: + - POSTGRES_DB=hummingbot_api + - POSTGRES_USER=hbot + - POSTGRES_PASSWORD=hummingbot-api + volumes: + - postgres-data:/var/lib/postgresql/data + 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 @@ -72,3 +93,4 @@ volumes: emqx-data: { } emqx-log: { } emqx-etc: { } + postgres-data: { }