This is a docker-compose template for a lemp stack.
Make sure to change both the root password under the mysql service, and the absolute URI on the phpmyadmin container.
You can also expose phpMyAdmin locally instead of remotely by properly configuring the ports.
Default locations:
(Original) -> (Your server)
/var/www/html
-> ./webroot
/etc/nginx
-> ./nginx
/etc/nginx/sites-enabled
-> ./nginx/sites-enabled
/var/lib/mysql
-> ./mariadb
(MariaDB Disk Storage)
/sessions
-> ./phpmyadmin/sessions
(phpMyAdmin session storage)
Don't forget! -> To use phpMyAdmin behind the nginx container, you need to configure a proxy-pass entry on it.
nginx proxy_pass
example:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name phpmyadmin.your.domain;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://phpmyadmin/; #! phpmyadmin is the docker host !
proxy_read_timeout 90;
}
}
why not use the fpm version or fpm-alpine instead of apache webserver phpmyadmin?