Simple environment for php framework/cms development based on docker and git submodules. Can be used in laravel/lumen project.
- Docker webdevops environment with php7.3.
- Example VS Code settings for xdebug.
- Copy ssh form given directory to make possible to use git inside the container.
- Make file to manage creation.
- Database container.
- PhpMyAdmin container.
name | features | ports |
---|---|---|
server | Contains apache, php, xdebug and zsh shell. Optionally your ssh keys can be copied into it so you can use git inside this container. | apache: 9001 php: 9000 |
db | Contains maria db. Credentials | 3306 |
phpmyadmin | Contains phpmyadmin that operates on db container data. Credentials | 9002 |
key | value |
---|---|
host | db |
user name | root |
password | root |
default db name | workspace |
key | value |
---|---|
user name | root |
password | root |
- Open terminal.
- Go to you project directory:
cd your/project/dir/name
- Clone this repo:
# If your project use git:
git submodule add https://github.com/karoldabro/dev-php-env.git .docker
# If your project do not use git:
git clone https://github.com/karoldabro/dev-php-env.git .docker
- Copy .env file into your project catalog.
cp .docker/.env .env
- (Optional) Copy Makefile into your project catalog.
cp .docker/Makefile .
- Fill .env file with your data.
In below examples there are always two commands, first using Makefile, second is traditional approach by docker commands.
# By Makefile command:
make
# By alternative command:
docker-compose -f .docker/docker-compose.yml up -d
# By Makefile command:
make down
# By alternative command:
docker-compose -f .docker/docker-compose.yml down
# By Makefile command:
make server
# By alternative command:
docker exec -it docker_server_1 /bin/zsh
# By Makefile command:
make db
# By alternative command:
docker exec -it docker_db_1 /bin/bash
# By Makefile command:
make pma
# By alternative command:
docker exec -it docker_phpmyadmin_1 /bin/bash