This is the companion repository for How to use Docker for local web development: an update. Please refer to it for a full explanation.
It contains a basic LEMP stack running with Docker, intented to be used for local web development.
Install Docker on your machine using one of these three ways:
Clone the project:
$ git clone email@example.com:osteel/docker-tutorial-2.git
From the project root:
$ docker-compose up -d
localhost from your browser.
The different services, volumes and networks are described in
- a service for Nginx
- a service for PHP-FPM
- a service for MySQL
- a service for phpMyAdmin
- a volume to make MySQL data persistent
- a network for database access
- a network for HTTP requests
All of the services are using official images.
When building and starting containers for the first time with Docker Compose, a database named
project will be created by default. You can change this in the
A default Nginx configuration is also copied over.
www/html/ directory is mounted into the one served by Nginx on the container, so any update to the code is available without having to rebuild the container.
The MySQL data sits in its own directory attached to its own named volume to make it persistent.
The application is available on the port 80 of the host machine.
phpMyAdmin is available on port 8080.
Again, for the complete tutorial please head to the original post.