How to set up a PHP dev environment on Docker (With MySQL and PHPMyAdmin)

Опубликовано: 01 Октябрь 2024
на канале: Abstract programmer
956
21

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