This repository contains a little docker-compose configuration to start a LAMP (Linux, Apache, Mysql, PHP) stack.
The following versions are used.
- PHP 7.3 (Apache)
- MySQL 5.7
The Apache vhost configuration can be found in config/vhosts/.
You can also set the following environment variables, for example in the included .env file:
| Key | Description |
|---|---|
| APP_NAME | The name used when creating a container. |
| MYSQL_ROOT_PASSWORD | The MySQL root password used when creating the container. |
| MYSQL_USER | A MySQL user to create when creating the container. |
| MYSQL_PASSWORD | A password for the above mentioned user. |
| MYSQL_DATABASE | A database to create when creating the container. |
To use it, simply follow the following steps:
Clone this repository with the following command: git clone https://github.com/stevenliebregt/docker-compose-lamp-stack.git.
Update the variables in .env.
Start the server using the following command inside the directory you just cloned: docker-compose up.
You can use the following command to enter a container:
Where {CONTAINER_NAME} is one of:
docker exec -ti {CONTAINER_NAME} bash
OR on Windows
winpty docker exec -ti {CONTAINER_NAME} bash
{APP_NAME}-web{APP_NAME}-db