Skip to content

Simple environment for laravel project, based on laradock.

License

Notifications You must be signed in to change notification settings

cs-eliseev/docker-for-laravel

Repository files navigation

English | Русский

DOCKER FOR LARAVEL

Packagist GitHub repo size

Description

Simple environment for laravel project, based on laradock.

Info

External ports

Service Port
HTTP 80
HTTPS 443
Redis WebUI 6007
Echo Server 7102
Socket 7103
Mailhog 8025
XDebug 9003
Swagger Editor 5151
Swagger WebUI 5555

Usage

I - Install

Git

Clone this repository locally:

git clone https://github.com/cs-eliseev/docker-for-laravel.git

Download

Download the latest release here.

II - Install Docker

III - Import dependency

  1. Import laradock

    git clone https://github.com/laradock/laradock.git dockers

VI - Import laravel project

Laravel config example: .env.example-for-laravel

  1. Import example project: laravel for docker

    git clone https://github.com/cs-eliseev/laravel-for-docker-example.git src
  2. Create a new Laravel project to Docker

    composer create-project --prefer-dist laravel/laravel src
  3. Git clone project to Docker

    git clone <link> src

V - Add config

cp .env.example .env

VI - BUILD

docker-compose up -d --build

Paths

  1. Laravel project path
./src
  1. Environment path
.env
  1. Logs path
./logs
  1. Laradock containers path
./dockers
  1. Containers settings path
./configs

Docker containers

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

Settings

All settings in the file .env

General settings:

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

Ports settings:

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

Container commands

  1. Build container

    docker-compose up -d --build
  2. Star containers

    docker-compose start
  3. Stop containers

    docker-compose stop
  4. Show run containers

    docker ps
  5. Show all containers

    docker ps -a
  6. Connect application container

    docker exec -it laravel-workspace bash
  7. Docker logs

    docker logs <container_name>

License

The DOCKER FOR LARAVEL set of settings and configurations licensed under the MIT license. Please see License File for more information.


GitHub @cs-eliseev

About

Simple environment for laravel project, based on laradock.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published