定制 coroin/homeport 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

coroin/homeport

Composer 安装命令:

composer require coroin/homeport

包简介

Laradock multi-project helpers

README 文档

README

Homeport is a script (homeport) installed your project-root with shortcuts to streamline your workflow while interacting with laradock in a multi-project environment.

Prerequesites

Homeport requires Docker and Laradock.

Install laradock in the same root folder as your other projects.

It is recommended to use the ~/code folder

/home/USER/code/            /home/USER/code/
├── a-project               ├── a-project
├── b-project               ├── b-project
├──                         ├── laradock
├── z-project               ├── z-project

Run this to create the ~/code folder (if it doesn't already exist) and install laradock:

mkdir -p ~/code && cd ~/code
git clone https://github.com/Laradock/laradock.git
cd laradock

Copy the env-example to .env and enable packages:

cp env-example .env
perl -i -pe's/PHP_FPM_INSTALL_IMAP=false/PHP_FPM_INSTALL_IMAP=true/' .env
perl -i -pe's/WORKSPACE_INSTALL_IMAP=false/WORKSPACE_INSTALL_IMAP=true/' .env
perl -i -pe's/WORKSPACE_INSTALL_PYTHON=false/WORKSPACE_INSTALL_PYTHON=true/' .env

Installation (only required for a new project)

Install Homeport in your project:

composer require coroin/homeport
php artisan vendor:publish --provider="Homeport\HomeportServiceProvider"
chmod +x homeport

Review the homeport script and customize for your project, if needed:

## Homeport Configuration

# 1. set path to laradock files
LARADOCK="${HOME}/code/laradock"        # note: must use ${HOME} instead of ~

# 2. set project name
PROJECT="${PWD##*/}"                        # defaults to current folder

# 3. specify database config
DATABASE_NAME="${PROJECT}"                  # defaults to project-name
DATABASE_PASS=root                          # DO NOT CHANGE (laradock default)
DATABASE_TYPE=mariadb                       # [mysql, mariadb]

# 4. select containers to run
CONTAINERS="nginx ${DATABASE_TYPE} redis"   # default uses nginx, database and redis

Initial Setup (required one time per project)

Add entry to your hosts file:

It is recommended to use the .test top-level-domain for your localdev

127.0.0.1   yourproject.test

On Mac/*NIX this file is located at /etc/hosts. On Windows, it is C:\Windows\system32\drivers\etc\hosts

Create the database and nginx config file:

./homeport setup

Note: If this is the first time you have run this command, it may take some time to download and build the docker images.

Usage

Any command not defined in the homeport script will default to being passed to the docker-compose command.

If no command is used, it will run docker-compose ps to list the running containers used by laradock.

Starting and Stopping Laradock

# start laradock
./homeport up

# stop laradock
./homeport down

# restart laradock
./homeport restart  # same as running ./homeport down && ./homeport up

Artisan, Composer, and NPM

# run artisan commands
./homeport artisan <command>
./homeport art <command> # "art" is a shortcut to "artisan"

# run composer commands
./homeport composer <command>
./homeport comp <command> # "comp" is a shortcut to "composer"

# run npm commands
./homeport npm <command>

MySql and Redis

# access the database
./homeport sql

# access the redis cli
./homeport redis

PHPUnit and Debugging

# run phpunit tests
./homeport test <arguments>
./homeport t <arguments> # "t" is a shortcut to "test"

# tail the laravel log
./homeport tail
./homeport log <command> # "log" is an alias to "tail"
./homeport log -f # follow
./homeport log -n 10 # show 10 lines of the log

Rebuilding or Repairing Laradock

After an update to Laradock or making changes to the .env file, rebuild the docker images:

# start laradock
./homeport rebuild
./homeport repair # "repair" is an alias of rebuild

Upgrading Homeport

Run the following command each time composer update gives you a new version of homeport

# upgrade homeport
./homeport update
./homeport upgrade # "upgrade" is an alias of update

Learning Docker

If you're unfamiliar with Docker, check out Chris Fidao's awesome Docker in Development and Shipping Docker courses at serversforhackers.com.

Contributing

  1. Fork this repo
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固