0

I have compose file that which have mariadb service in it. But I have completely separated dedicated mariadb machine in my network and I want to use it instead of a mariadb container.

Is there a way to expose remote port of that MariaDB to the my compose services without using SSH port forwarding?

thiras
  • 165
  • 1
  • 1
  • 7

1 Answers1

0

You can't expose a remote port directly, but you could configure your container to look at remotehost:port for the DB. If the host and port is random you'll need to implement some sort of service discovery mechanism like Consul.

Alternatively you can look at the container networking products what allow containers to talk across hosts 'natively'.

Jason Martin
  • 4,865
  • 15
  • 24