phpmyadmin / docker

Docker container for phpMyAdmin
https://hub.docker.com/_/phpmyadmin
GNU General Public License v3.0
665 stars 456 forks source link

Customizing Apache configuration #388

Open Cyanat opened 1 year ago

Cyanat commented 1 year ago

Hi, I'm using the apache phpMyAdmin Docker image. I would like to customize the apache configuration of the conainter adding a file in /etc/apache2/sites-enabled/ (to enable https on port 443). How should store my .conf in this folder when starting this image? Do I have to use -v /host/ssl.conf:/etc/apache2/sites-enabled/ssl.conf ? Or is there another way to manage the apache configuration of this docker image (environment variables, entrypoint.sh, dockerfile...) ? Thanks!

williamdes commented 1 year ago

Hi,

I think this is a good idea to add a configuration folder to load user configs. It would simply the SSL setup that is currently not possible.

williamdes commented 1 year ago

Here is some configuration changes we do: https://github.com/phpmyadmin/docker/blob/905cae841eff6eb0d24755435f44e26af0488093/apache/docker-entrypoint.sh#L34

Cyanat commented 1 year ago

Hi,

I think this is a good idea to add a configuration folder to load user configs. It would simply the SSL setup that is currently not possible.

Indeed, I was expecting something like that after seeing that the apache folder was including folder site_enabled and sites-available.

Until there, I managed to store my own conf files in site_enabled using a Dockerfile:

FROM phpmyadmin/phpmyadmin:5.2.0

ADD ssl.conf /etc/apache2/sites-enabled/ssl.conf

I'm not really comfortable with docker yet, not sure it's the right way to do it but... seems to work.

williamdes commented 1 year ago

Hi @Cyanat

If this is the only change you do you could use a docker volume

image: phpmyadmin:5.2
volumes:
    - "./ssl.conf:/etc/apache2/sites-enabled/ssl.conf:ro"

By the way please use the official image phpmyadmin, see: #363

Cyanat commented 1 year ago

You're right, I switched to the official image.

For now, it's the only change, so I know using a volume would be easier, but I prefer if the conf file is stored in the container only, not on host.

Thanks for your help and advice.

williamdes commented 1 year ago

Okay, I am happy it works fine for you now. Let's keep track of further progress to implement a folder for config files