Base docker environment for LAMP projects
This docker based environment can be used for local development without installing the needed applications locally. Instead only docker and docker-compose and some configuration is required.
Basically there are two main folders: build and www.
The build folder consists of dockerfiles and configurations for every application.
The www folder is the folder that should contain your application code.
Also it serves as a share between all applications.
- Install docker and docker-compose
- Go into the root folder and run
sh scripts/install/create-env.sh. This creates your .env file with additional data. - Optional additional configuration:
- To rename the containers, change
COMPOSE_PROJECT_NAMEin.env. - To persist mysql data, uncomment volumes of mysql in docker-compose.yml.
- To rename the containers, change
- Build everything folder with
docker-compose build - Start it with
sh scripts/start.sh. (Or use commanddocker-compose up, use the parameter-dto run ist in background.) - Stop with
sh scripts/stop.shor use commanddocker-compose down - (To check the running docker container use
docker ps. When there are docker container running, you will see a list that shows information about every container. You can use the container name to execute commands. - Connect with
sh scripts/ssh.shto your running server container.) - Copy your app content into the
wwwfolder. If you use composer, the composer.json file should be inside this folder too. Thewwwfolder is your app root folder. - If you use composer, and run
composer install(in ssh connection), otherwisesh scripts/install/composer-install.sh. This installs your dependencies. - If you use
oforgeand want to rebuild the templates, runsh scripts/build-templates.sh