Laradock mini version by HanhBT
-
PHP-FPM (xDebug), PHP-Worker, MailHog
-
Nginx, Apache
-
MySQL
- PHPMyAdmin: http://localhost:8081
- Host: mysql:3306
- Users:
- root / root
- default / secret
You can change in
.env
file andphpmyadmin/config.inc.php
-
Mailhog
- Web: http://localhost:8025
- SMTP: mailhog:1025
-
Redis
- Host: redis:6379
-
Elastic Search
- Host: elasticsearch:9200
-
Laravel Echo Server
- Port: 6001
- Clone this repository to project folder.
- Change
.env
COMPOSE_PROJECT_NAME
to your project name. - Config xDebug (optional)
- Edit
/etc/hosts
, add domain for your project:
127.0.0.1 docker.dev
-
Create
.conf
file inapache2/sites
ornginx/sites
folder. Examples in these folder will help you. -
Config SSL (optional)
-
Addition config for magento:
- edit
./.env
file:
WORKSPACE_INSTALL_SOAP=true PHP_FPM_INSTALL_SOAP=true PHP_WORKER_INSTALL_SOAP=true
- edit
./build
and./start
file, addelasticsearch
to each docker-composer command line
- edit
-
Run bash:
cd docker
./build
./start
- Done!
./build # build images
./build --nc # build images without cache
./start # start docker
./stop # stop docker
./restart # stop and start docker
./restart -q # restart docker
./bash # exec to workspace bash
./bash -r # exec to workspace bash as root user
# exec to other service bash
./bash nginx
./bash php-fpm
./bash mysql
./bash phpmyadmin
cd ./ssl
cp domains.ext.example domains.ext
- Open
domains.ext
, changedocker.dev
to your domain, or add domain with format
DNS.2 = domain.com
DNS.3 = other-domain.com
- Add these line to docker/nginx/sites config
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/default.crt;
ssl_certificate_key /etc/nginx/ssl/default.key;
Or Apache in VirtualHost *:443
tag:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/default.crt
SSLCertificateKeyFile /etc/apache2/ssl/default.key
./restart
(if needed)
Goto: chrome://settings/certificates
> Authorities > Import > Select RootCA.crt in ./ssl
Goto: about:preferences#privacy
> View Certificates > Authorities > Import > Select RootCA.crt in ./ssl
- Edit
./.env
file:
# for php-fpm debug (required)
PHP_FPM_INSTALL_XDEBUG=true
# for php-cli debug (optional)
WORKSPACE_INSTALL_XDEBUG=true
- Install VSCode extension: felixfbecker.php-debug
- Create file
./.vscode/launch.json
with bellow content, replace/project_path
with your project path.
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www": "/project_path",
}
}
]
}
- Click
Listen for xDebug
in Editor/IDE toolbar. - PHP 8 or newer use xDebug 3 with some changes, you must install a Browser extension for enable debug mode.