phpmyadmin and mariadb - need help setting with docker setup

Currently reading
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

Frustrating indeed. I will read further and try to discover what is all about. Thanks for your sincere...
Replies
20
Views
8,523
Please re-read everything I wrote. I gave you the exact hints what needs to be done for which option, and...
Replies
17
Views
3,551
There are two defaults network in docker, the bridge network and the host. I created another one called...
Replies
27
Views
8,444
You can run cmd.exe to get a command window from which you can execute SSH commands. However, my personal...
Replies
36
Views
3,325
  • Solved
I haven't thought about it as a file system level cache. If it is, it would make sense that both benefit...
Replies
8
Views
3,849
I'm not sure why I get that 172.17-address or if there's a way to change that...?
Replies
20
Views
6,231

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