docker icon indicating copy to clipboard operation
docker copied to clipboard

Customizing Apache configuration

Open Cyanat opened this issue 3 years ago • 6 comments

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!

Cyanat avatar Nov 04 '22 16:11 Cyanat

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 avatar Nov 05 '22 10:11 williamdes

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

williamdes avatar Nov 05 '22 10:11 williamdes

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.

Cyanat avatar Nov 07 '22 11:11 Cyanat

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

williamdes avatar Nov 07 '22 11:11 williamdes

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.

Cyanat avatar Nov 07 '22 11:11 Cyanat

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

williamdes avatar Nov 07 '22 11:11 williamdes