• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

supermavster/docker-laravel-8: A simple Docker - Laravel 8 - MySQL - Redis - PHP ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

supermavster/docker-laravel-8

开源软件地址(OpenSource Url):

https://github.com/supermavster/docker-laravel-8

开源编程语言(OpenSource Language):

Dockerfile 67.5%

开源软件介绍(OpenSource Introduction):

Docker - Laravel

Docker

Image

A pretty simplified Docker Compose workflow that sets up a LEMP (Linux, NGINX, MySQL, PHP) network of containers for local Laravel development.

Ports

Ports used in the project:

Software Port
nginx 8080
phpmyadmin 8081
mysql 3306
php 9000
xdebug 9001
redis 6379

Use

To get started, make sure you have Docker installed on your system and Docker Compose, and then clone this repository.

  1. Clone this project:

    git clone https://github.com/supermavster/docker-laravel-8.git
  2. Inside the folder docker-laravel-8 and Generate your own .env to docker compose with the next command:

    cp .env.example .env
  3. You need Create or Put your laravel project in the folder source; to create follow the next instructions Here.

  4. Build the project whit the next commands:

    docker-compose up --build

Remember

The configuration of the database must be the same on both sides .

# .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_password
DB_ROOT_PASSWORD=secret
# source/.env
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_password

The only change is the DB_HOST in the source/.env where is called to the container of mysql:

# source/.env
DB_HOST=mysql

Special Cases

To Down and remove the volumes we use the next command:

docker-compose down -v

Update Composer:

docker-compose run --rm composer update

Run compiler (Webpack.mix.js) or Show the view compiler in node:

docker-compose run --rm npm run dev

Run all migrations:

docker-compose run --rm artisan migrate



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap