This is docker-compose with included: PHP
(7.0
, 7.1
, 7.2
, 7.3
, 7.4
, 8.0
, 8.1
), Nginx
, MySQL
, Redis
, Memcached
, RabbitMQ
- Clone this repository:
git clone https://github.com/vityachis/docker-compose.git
- Copy
docker-compose.yml
anddocker
to your project root directory - Rename the folder with required PHP version to
php
(indocker
folder) - Delete unnecessary PHP versions from
docker
folder - Set ENV variables (if need)
- Configure Xdebug in PhpStorm
- ENJOY :)
Mapping local ports to ports in Docker container (ports for services in Docker container remain default): APP_PORT
, APP_SECURE_PORT
, MYSQL_PORT
, REDIS_PORT
, RABBITMQ_PORT
, RABBITMQ_MANAGEMENT_PORT
ROOT_PATH
(default/var/www/public
)
APP_PORT
(default80
)APP_SECURE_PORT
(default443
)XDEBUG_PORT
(default:9003
)XDEBUG_IDEKEY
(defaultIDEKEY
)NGINX_HOST
(defaultapp.local
)
MYSQL_PORT
(default3306
)DB_DATABASE
(defaultapp
)DB_USERNAME
(defaultapp
)DB_PASSWORD
(defaultapp
)DB_ROOT_USERNAME
(defaulturoot
)DB_ROOT_PASSWORD
(defaultproot
)
REDIS_PORT
(default6379
)
RABBITMQ_PORT
(default5672
)RABBITMQ_MANAGEMENT_PORT
(default15672
)RABBITMQ_USER
(defaultguest
)RABBITMQ_PASS
(defaultguest
)
- Preferences
- PHP:
- Add new CLI Interpreters:
- Server:
Docker
- Image name:
%PROJECT_FOLDER_NAME%_php:latest
- Server:
- Path mappings (or Docker container
[Host path] -> [Container path]
):<Project root> -> /var/www
- Xdebug:
- Debug port:
${XDEBUG_PORT}
- DBGp Proxy: IDE key:
${XDEBUG_IDEKEY}
; Host:host.docker.internal
; Port:${XDEBUG_PORT}
- Debug port:
- Servers:
- Host:
${nginx_host}
(this is NOT an environment variable) - Port:
80
- Debugger:
Xdebug
- Use path mappings:
<Project root> -> /var/www
;<Root path (where is index.php)> -> ${ROOT_PATH}
- Host:
- Add new CLI Interpreters: