How to set up a PHP dev environment on Docker (With MySQL and PHPMyAdmin)
HTML-код
- Опубликовано: 1 дек 2024
- docker-compose.yml:
version: '3.8'
services:
apache-php:
image: apache-mysqli
build:
context: .
dockerfile: Dockerfile
volumes:
C:/php_ws/abstract-programmer:/var/www/html
ports:
"80:80"
networks:
app-network
mysql:
image: mysql
volumes:
C:/php_ws/DB:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: pw
networks:
app-network
phpmyadmin:
image: phpmyadmin
environment:
PMA_HOST: mysql
ports:
"8080:80"
depends_on:
mysql
networks:
app-network
networks:
app-network:
driver: bridge
Just want to extend my thanks for this awesome tutorial, very straight forward and easy to follow with clear explanations. I was having trouble following other guides in getting my phpmyadmin and mysql to work, I have noticed this is because the PMA host was not linked corectly. The additional info for docker compose was very helpful and insigthful in using the volumes. Awesome Job and thanks once again.
Thank you for your feedback!👍
thanks very very much for this tutorial its help me a lot
Glad to hear that
you rock bro, thanks a lot baby
🙏