- PHP 8.2
- Composer 2
- xDebug
- htop
- mc (Midnight Commander)
-
Install Docker and Docker-compose
-
Install GNU make (
apt install make
) -
Prepare project:
git clone https://github.com/yiisoft/yii-dev-tool.git cd yii-dev-tool make bash
That's all. You just need to wait for completion!
After completion you are running a bash
inside the docker container environment.
TBD
Now you can run a bash shell in the created container:
make bash
After that, you can use the commands of yii-dev-tool on the machine as usual. For example:
./yii-dev install di,rbac,yii-cycle,view
If your ssh keys are located in ~/.ssh
the docker environment automatically uses the SSH keys from the host machine.
Therefore, you do not need to separately generate keys for the guest machine. Just make sure the keys from your host machine are added
to your list of keys on GitHub. This is necessary in order to access
remote repositories via SSH protocol.
If your ssh keys are not located in ~/.ssh
you need to adjust the path in docker-compose.override.yml
.
The bash history of the container is automatically saved to file yii-dev-tool/docker/home/.bash_history
– this allows you to not lose history between recreations of the container.
By default the container is using PHP 8.2. If you want to change the PHP version you can do the following:
make docker-down
# Change version of PHP in docker/Dockerfile line 1
make bash
This will re-build the container with the new PHP version.
The Docker environment has xDebug installed by default.
You can set the PHP_ENABLE_XDEBUG
environment variable in docker-compose.override.yml
to enable or disable xDebug.
For Remote Debugging, use the following settings in PHPStorm or other IDE:
- IDE-Key:
yii_dev
- Port: 9003
- Server Path-Mapping: Repository Root of
yii-dev-tool
->/app
in the container.
xDebug will automatically connect to the docker host machine.