mortenscheel/docker-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mortenscheel/docker-laravel

最新稳定版本:v0.11.0

Composer 安装命令:

composer create-project mortenscheel/docker-laravel

包简介

Docker helper for Laravel projects

README 文档

README

A CLI tool to initialize and manage a Docker environment for a Laravel project.

Why?

I liked the simplicity of Laravel Sail, but wanted to have an actual web-server, in stead of just artisan serve.

How?

In stead of a simple bash script like sail, I built this as a Laravel Zero app in order to take advantage of the functionality from Symfony Commands and Processes.

The first argument provided to docker-laravel is used to determine where to send the command (most commands are sent to the app container, but compose commands like up, build and pull are run on the host).

Installation

composer global require mortenscheel/docker-laravel

Or download builds/docker-laravel and place in PATH.

Usage

I recommend creating an alias to make everyday use simpler.

alias d="~/.composer/vendor/bin/docker-laravel"

Initialize project

d init --help

Description:
  Initialize Docker environment

Usage:
  init [options]

Options:
      --slug[=SLUG]     Slug used for container prefix
      --php[=PHP]       PHP-FPM version [default: "8.2"]
      --node[=NODE]     NodeJS version [default: "20"]
      --redis           Include Redis service
      --meilisearch     Include Meilisearch service
      --selenium        Include Selenium service
      --update          Update existing environment

This will copy the /docker folder and /docker-compose.yml to your project It will also update your .env (after you've approved the changes)

Proxied commands

When you run the command inside an initialized Laravel project, docker-laravel will automatically proxy the commands. Examples

d up -d # runs docker compose up -d. All compose commands are supported
d composer require foo/bar # Commands starting with composer are sent to composer in the app container
d artisan route:list # Sent to artisan in the app container
d a route:list # a is aliased to artisan
d route:list # if the first param includes a colon, it's interpreted as an artisan command
d debug some:command # Runs some:command in Artisan with xdebug enabled
d xdebug on/off/status # Controls xdebug in the app container
d shell/zsh/bash # Enter the app container as the non-root (laravel) user
d root-shell # Enter app as root

Note: this documentation is a work in progress. To see all the available subcommands and features, take a look at DefaultCommand

统计信息

  • 总下载量: 87
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固