DEV Community

Cover image for Docker-compose file for php development
Ismael Garcia
Ismael Garcia

Posted on • Edited on

Docker-compose file for php development

I'm starting to learn PHP in deep in these days, so i needed a small docker-compose file to create a small container that have the most essentials requirements for my PHP learning path.

  • PHP
  • MySQL
  • PhpMyAdmin

So here is the docker-compose.yml file for anyone you all to get up fast and easy docker container to test or develop in PHP.

version: "3.7"

services:
    php:
        image: php:7.2-apache
        ports: 
            - 8000:80
        volumes: 
            - ./www:/var/www/html
    database:
        image: mysql
        environment: 
            MYSQL_ROOT_PASSWORD: root
            MYSQL_USER: leamsigc.com
            MYSQL_PASSWORD: leamsigc.com
            MYSQL_DATABASE: leamsigc.com
    php-admin:
        image: phpmyadmin/phpmyadmin
        ports: 
            - 8001:80

Enter fullscreen mode Exit fullscreen mode

Top comments (0)