docker访问外部数据库,将docker-compose连接到外部数据库

I have a set up of 4 containers that need to talk to each other and two of those need to connect to an external database.

I started working with composer and link everything together.

The containers are able to talk with each other without many issues, however they can't connect to the external database.

The external DB is up and running and I can easily connect to it via shell.

The docker-compose file looks like this:

version: "3"

services:

bridge:

# version => 2.1.4

build: ./lora-gateway-bridge

ports:

- "1680/udp:1700/udp"

links:

- emqtt

- redis

environment:

- MQTT_SERVER=tcp://emqtt:1883

networks:

- external

restart: unless-stopped

loraserver:

# version => 0.16.1

build: .

你可能感兴趣的:(docker访问外部数据库)