Basic LAMP stack environment built using Docker Compose.
🚨 Important : This Stack is build for PERSONAL LOCAL development and NOT FOR PRODUCTION USAGE
Assume you have / Tested on :
- Ubuntu 20.04 LTS
- Docker version 19.03.13
- Docker Compose version 3 (see compatibility)
- ☕ / 🍵
Include in the Docker Compose (tested on Ubuntu 20.04 LTS):
- PHP Apache (Include: 5.6, 7.1, 7.4)
- Portainer
- PhpMyAdmin
- Database (Include: mariadb 10.3, mysql 5.7, mysql8)
- Node (Include: 10.16, 12.4)
- Clone this repository on your local computer
- Init, configure .env as needed:
make env - Add yours entry points in
./config/vhosts.txtfile (see "Entry Point" below) - Run generation of vhosts files :
make generate-vhosts - Add your entry point into
/etc/hostsfile (see "Entry Point" below) - Run Docker composer:
- make
run-buildfor build and start - Or
make runfor start only
- make
Your LAMP stack is now ready!! You can access it via localhost.
Now you can access to your environnement:
- Your Http homepage localhost
- Portainer localhost:9999
- PhpMyAdmin on localhost:8090
This package comes with default configuration options. You can modify them by creating (Step 2.) .env file in your root directory.
- Add yours vhosts URL and ENTRYPOINT Folder in
./config/vhosts.txt: - Run generation of vhosts files :
make generate-vhostsand Copy generate host line - Paste your entry point in
/etc/hostsafter localhost:
# 1
➜ nano /config/vhosts.txt
# Add your URL and PATH with delimiter: `|`
my-project.localhost|\/var\/www\/my-project\/web
# 2
➜ make generate-vhosts
...
Modify your /etc/host file with these lines:
127.0.0.1 my-project.localhost
...
# 3
➜ sudo nano /etc/hosts
127.0.0.1 localhost # Paste your host line after this line
127.0.0.1 my-project.localhostPHP_INI: In each PHP Bin you can define your custom php.ini
/docker/{PHP_VERSION}/php.inito meet your requirements.
Available script
makeormake helpfor helpingmake envfor init env filemake runfor startmake run-buildfor build and startmake run-phpfor access into your container phpmake generate-vhostsfor create vhosts files confmake check-vhostsfor check if url is available
For windows user check the
makefilefor cmd.
Docker Shortcut:
docker psList all containersdocker ps -aqList all containers (only IDs)docker stop $(docker ps -aq)Stop all running containers
Show Docker log into your server:
➜ docker logs --tail 50 --follow --timestamps [docker-container-name]
# Example
➜ docker logs --tail 50 --follow --timestamps my-container-nameChange
[docker-container-name]by your container name
If this project help you, feel free to give me a cup of coffee :)
And dont forget: KISS, DRY & CLEAN CODE
Spécial thanks to @Medzoner and @floyoops !
🍻 Have Fun ! Made with ❤ by @Sp0ne - Lead Developer - vinces.io