Documentation on docker-compose config.user.inc.php #82

Closed
jandor64 opened this Issue Nov 11, 2016 · 9 comments

Projects

None yet

4 participants

@jandor64

I am having difficulty understanding how to add a config file here when using docker-compose, the instructions only seem to be for Docker CLI

Please advise if you can, thank you.

@nijel nijel added the enhancement label Nov 14, 2016
@trombini77
trombini77 commented Dec 27, 2016 edited

jandor64, I use the phpmyadmin in Docker with docker compose using the following lines inside docker-compose.yml (I don´t know your skills with Docker but anyway create a docker-compose.yml in a location that you will run the docker-compose utility):

phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
ports:
- 8080:80
volumes:
- /sessions

P.S. this comment don´t show the 4 spaces in the begining all lines after "phpmyadmin:" that is necessary (please don´t use Tab instead of Space in the text editor of docker-compose.yml)
In this example I also use the PMA_ABITRARY variable that enable to define the server host in the login phpmyadmin login page.
After this you can start only it using the following command (remember you need to be in the directory of docker-compose.yml file):
docker-compose up -d phpmyadmin

(up - start the container)
(-d - start as daemon)
(phpmyadmin - is the line "phpmyadmin:" in the docker-compose.yml).

I hope this help your understanding.

@jandor64
jandor64 commented Dec 28, 2016 edited

@trombini77 Thank you for taking the time to answer my question. Unfortunately, it looks like I could have been clearer in my question.

I do have PHPMyAdmin running, using a docker-compose.yml. What I was hoping to do was modify PHPMyAdmin's settings, each time using a config.user.inc.php that is local to the project

The documentation for this GitHub project only mentions how to do this from the terminal using the run command.

I imagine the solution is to use a volume mapping, something like:
volumes:
- "./my_php_config.php:/etc/phpmyadmin/config.user.inc.php"

However, I could not get this to work. Thank you for taking the time to look into this; hopefully, it helps others!

@nijel
Member
nijel commented Jan 2, 2017

@jandor64 The path to the user configuration has been changed recently, so in case you're using older version of the Docker container phpMyAdmin will not use it.

@skorzhevsky

@jandor64 works fine for me:

volumes:
 - /sessions
 - ~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
 - /var/run/mysqld/mysqld.sock:/tmp/mysqld.sock
@nijel nijel self-assigned this Feb 6, 2017
@nijel nijel added a commit to phpmyadmin/phpmyadmin that referenced this issue Feb 6, 2017
@nijel nijel Add example for customizing configuration file using docker-compose
Fixes phpmyadmin/docker#82

Signed-off-by: Michal Čihař <michal@cihar.com>
87ebf13
@nijel nijel added a commit to phpmyadmin/phpmyadmin that closed this issue Feb 6, 2017
@nijel nijel Add example for customizing configuration file using docker-compose
Fixes phpmyadmin/docker#82

Signed-off-by: Michal Čihař <michal@cihar.com>
87ebf13
@nijel
Member
nijel commented Feb 6, 2017

Thanks for confirming, I've added example to our documentation as well.

@skorzhevsky

Just one thing, config.user.inc.php must start from "<?php", which was not obvious to me :)

@nijel nijel added a commit to phpmyadmin/phpmyadmin that referenced this issue Feb 7, 2017
@nijel nijel Provide more detailed guideline for customizing configuration
See phpmyadmin/docker#82

Signed-off-by: Michal Čihař <michal@cihar.com>
e79574b
@nijel
Member
nijel commented Feb 7, 2017

Okay, I've added more information on this topic :-)

@jandor64

Thank you @nijel and @skorzhevsky I'm sure this will be helpful to others!

@nijel
Member
nijel commented Feb 14, 2017

If you still find something confusing, don't hesitate to open issue or submit patch ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment