I’m quite new to docker. Although that I just started I’d like to setup all needed stuff with docker. And I want to follow the docker philosophy of one command per container. But there is currently one thing I don’t understand.
I’ve started with a simple webserver + database: nginx, phpfpm, mysql and phpmyadmin in separate containers.
I’m using docker-compose.
So I’m having the wwwdata container which only has the /var/www directory which is also used in nginx, phpfpm and phpmyadmin is stored there (there are maybe better ways but I’d like to figure out what I’m doing wrong). So in the phpmyadmin Dockerfile I’m downloading und unzippin phpmyadmin and then store it to /var/www/phpmyadmin. Unfortunately I cannot see phpmyadmin in /var/www from other containers or from my host system. And I cannot even see it inside the phpmyadmin container although I’ve created it there. When I’m not creating /var/www as volume I can at least see phpmyadmin in the phpmyadmin container. So my resolution for now is: Create phpmyadmin installation somewhere else, use an entrypoint script and, if /var/www/phpmyadmin does not exist, move it there, so it is in the volume afterwards. I guess there is a better way, right? I thought files which are alreay existing in an image will still be there if I create a volume at this place? Isn’t that right?