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.txt
file (see "Entry Point" below) - Run generation of vhosts files :
make generate-vhosts
- Add your entry point into
/etc/hosts
file (see "Entry Point" below) - Run Docker composer:
- make
run-build
for build and start - Or
make run
for 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-vhosts
and Copy generate host line - Paste your entry point in
/etc/hosts
after 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.localhost
PHP_INI: In each PHP Bin you can define your custom php.ini
/docker/{PHP_VERSION}/php.ini
to meet your requirements.
Available script
make
ormake help
for helpingmake env
for init env filemake run
for startmake run-build
for build and startmake run-php
for access into your container phpmake generate-vhosts
for create vhosts files confmake check-vhosts
for check if url is available
For windows user check the
makefile
for cmd.
Docker Shortcut:
docker ps
List all containersdocker ps -aq
List 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-name
Change
[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