docker
docker copied to clipboard
Additional password protection
My mysql db has weak username password - root/root. Is there any option to start docker which add htaccess layer for more secure? Thank you.
Hi, I need this too, any solution for this now?
- create
apache-security.conf
in your project or some where.
<Directory /var/www/html>
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</Directory>
- create password file to your root project
$ htpasswd -c .htpasswd USERNAME
- map to docker container
phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
environment:
- PMA_HOST=XXX
- MYSQL_ROOT_PASSWORD=XXX
volumes:
- ./.htpasswd:/etc/httpd/.htpasswd
- ./apache-security.conf:/etc/apache2/conf-enabled/apache-security.conf
ports:
- 8080:80
Done!