Compose Instant AMP Docker Containers Group
May-2021
You can have your own LAMPP, XAMPP, MAMPP whatever, quickly as docker containers, even in seconds.
First, make sure you have docker service is up and docker-compose is installed. To check all of that:
~> docker-compose --version
if error; check Docker Basics notebook
Here’s the YML file which pulls the right images for you and build a container configuration automatically, sweet, no?
Save that as docker-compose.yml file and move it into your project folder.
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: pma
links:
- db
environment:
PMA_HOST: db
PMA_PORT: 3306
PMA_ARBITRARY: 1
restart: always
ports:
- 8081:80
volumes:
wordpress:
db:
Get that fella up, go to the file’s path and:
~> docker-compose up
Alright, stop it:
~> docker-compose stop
And get rid of the dirty clothes:
~> docker-compose down
It works well on Ubuntu 20.04 LTS with Docker 20.10.2, Docker Compose 1.28.4.
Cheerful affiliating on centralized dot-com era!