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
view raw socials.md hosted with ❤ by GitHub

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay