My workspace to easily develop php packages. Added as gitsubmodule.
- Docker webdevops enviroment with php7.3.
- Example VS Code settings for xdebug.
- Example PHP project configuration.
- Copy ssh form given directory to make possible to use git inside the container.
- Make file to manage creation
- Open terminal.
- Go to you project directory:
cd your/project/dir/name
- Clone this repo:
# If git is initiated in your project
git submodule add https://github.com/karoldabro/dev-php.git .docker
# If your project do not have version controll
git clone https://github.com/karoldabro/dev-php.git .docker
- (Optional) Copy .env file into your project catalog.
# If .env do not exists copy entire file
cp .docker/.env .env
# If .env exists append content to existing one
cat .docker/.env >> .env
- (Optional) Copy Makefile into your project catalog.
cp .docker/Makefile .
- (Optional) Fill .env file with your data.
# By Makefile
make
# By docker-compose
docker-compose -f .docker/docker-compose.yml up -d
# By Makefile
make down
# By docker-compose
docker-compose -f .docker/docker-compose.yml down
# By Makefile
make shell
# By docker-compose
docker-compose -f .docker/docker-compose.yml exec server sh -c "cd /app && /bin/zsh"
This repo contains many example files, with already setup configuration. You can easily use them in your project.
Remember to edit this file, change namespace and author. You can create your own by console command "composer init" but this contains useful libraries and configured namespaces.
cp .docker/.examples/.gitignore .
After this type:
composer update
This configuration contains divide your tests into: Unit and Integration, and configuration for test coverage.
cp .docker/.examples/phpunit.xml .
Remember to create tests directory:
mkdir tests && mkdir tests/Unit && mkdir tests/Integration
cp .docker/.examples/composer.json .
cp .docker/.vscode .vscode -r