phpmyadmin and mariadb - need help setting with docker setup

2
0
NAS
DS920+
Operating system
  1. Windows
Mobile operating system
  1. Android
Last edited:
I need some help with setting up phpmyadmin with mariadb as docker containers, as described in the tutorials (here and here). My Ultimate goal is to set up mariadb for the use with photoprism (also dockerised): Installation on Synology with mariadb - What worked for me · photoprism/photoprism · Discussion #3141

So I managed to set up the phpmyadmin and mariadb containers by following the instructions. They are running, but now I cannot connect to the web interface, which makes me think it is related to the network settings in the docker config. Hence, I have two questions:

1) Do I need to connect both containers (and then later the photoprism container) to a network bridge, and not to the host network?

2) If so, how can I connect that bridge network to my DSM IP range, so that I can do MY.DSM.IP.ADDRESS:PMAPORT?

Many thanks!

EDIT: in the meantime I managed to connect, but the first question remains: is using this setup typically done via a network bridge?
 
The docker way would be to put both container is a same user defined container network. User defined networks (=every bridge network, except the default bridge network) provide dns-based service discovery for service and container names, and all containers attached to the same user defined network can communicate with each other without any restriction. In phpmyadmin use the container name of the mariadb container and the container port for the connection. The mariadb container does not need to publish any ports, only the phpmyadmin container does.

The "I have no idea what I am doing, I don't care how it's done in docker, I just want it to be like what I know from vms" would be to publish ports on both containers and then just use the host-ip and published host port of the mariadb container.
-- post merged: --

I assume you have seen the docker compose file they provide?

I would highly recommend pasting this into the container manager as a starting point, remove the watchtower service, then adjust the volumes and environment variables as required.
 
thanks for taking the time to explain. I had started using docker images a while ago, but never with a bridge, always with the host network. what you say makes sense, but I still wonder why this wouldn't be possible by just using the host network - because of the firewall?

hadn't tried using compose files since synology introduced that functionality with the new app. will surely do so next time
 
I still wonder why this wouldn't be possible by just using the host network
It is possible. I would avoid it unless absolutely necessary. Using the host network means actually a lack of network namepace isolation. Think of namespaces as partitions, and that the container is going to use the partition the host uses itself.

If you use the host network, the app should be able to reach the db using localhost:{container-port} or {ds-ip}:{container-port}
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

You can run cmd.exe to get a command window from which you can execute SSH commands. However, my personal...
Replies
36
Views
5,010

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top