English | Русский
Simple environment for laravel project, based on laradock.
- Laravel application: http://localhost
Service | Port |
---|---|
HTTP | 80 |
HTTPS | 443 |
Redis WebUI | 6007 |
Echo Server | 7102 |
Socket | 7103 |
Mailhog | 8025 |
XDebug | 9003 |
Swagger Editor | 5151 |
Swagger WebUI | 5555 |
Clone this repository locally:
git clone https://github.com/cs-eliseev/docker-for-laravel.git
Download the latest release here.
- Install docker
- Install docker-compose
-
Import laradock
git clone https://github.com/laradock/laradock.git dockers
Laravel config example: .env.example-for-laravel
-
Import example project: laravel for docker
git clone https://github.com/cs-eliseev/laravel-for-docker-example.git src
-
Create a new Laravel project to Docker
composer create-project --prefer-dist laravel/laravel src
-
Git clone project to Docker
git clone <link> src
cp .env.example .env
docker-compose up -d --build
- Laravel project path
./src
- Environment path
.env
- Logs path
./logs
- Laradock containers path
./dockers
- Containers settings path
./configs
Service | Container name |
---|---|
Application | laravel-workspace |
Nginx | laravel-nginx |
PHP-FPM | laravel-php-fpm |
Cron | laravel-cron |
Horizon | laravel-horizon |
MySQL | laravel-mysql |
Mongo | laravel-mongo |
Redis | laravel-redis |
Memcached | laravel-memcached |
Laravel Echo Server | laravel-echo |
Soketi | laravel-socket |
Mailhog | laravel-mailhog |
Redis WebUI | laravel-redis-ui |
Swagger WebUI | laravel-swagger-ui |
Swagger Editor | laravel-swagger-editor |
All settings in the file .env
Key | Info |
---|---|
APP_NAME | Application name |
PATH_DOCKER | Laradock files path |
PATH_CONFIGS | Containers config path |
PATH_LOGS | Containers log path |
DATA_PATH_HOST | Containers data path |
APP_CODE_PATH_HOST | Application path |
APP_CODE_PATH_CONTAINER | Container application path |
PHP_VERSION | PHP version |
Key | Info |
---|---|
NGINX_HOST_HTTP_PORT | HTTP port |
NGINX_HOST_HTTPS_PORT | HTTPS port |
NGINX_PHP_UPSTREAM_PORT | Nginx upstream port |
MYSQL_PORT | Mysql port |
REDIS_PORT | Redis port |
MEMCACHED_HOST_PORT | Memcached port |
MONGODB_PORT | MongoDB port |
LARAVEL_ECHO_SERVER_PORT | Echo server port |
SOKETI_PORT | Soketi port |
SOKETI_METRICS_SERVER_PORT | Soketi metrics port |
MAILHOG_SMTP_PORT | Mailhog smtp port |
MAILHOG_HTTP_PORT | Mailhog http port |
SWAGGER_UI_PORT | Swagger WebUI port |
SWAGGER_EDITOR_PORT | Swagger editor port |
REDIS_WEBUI_PORT | Redis WebUI port |
REDIS_WEBUI_CONNECT_PORT | Redis WebUI connect port |
PHP_FPM_XDEBUG_PORT | XDebug port |
-
Build container
docker-compose up -d --build
-
Star containers
docker-compose start
-
Stop containers
docker-compose stop
-
Show run containers
docker ps
-
Show all containers
docker ps -a
-
Connect application container
docker exec -it laravel-workspace bash
-
Docker logs
docker logs <container_name>
The DOCKER FOR LARAVEL set of settings and configurations licensed under the MIT license. Please see License File for more information.
GitHub @cs-eliseev