kuaifan 5 lat temu
rodzic
commit
897c8f440e
5 zmienionych plików z 68 dodań i 14 usunięć
  1. 27 2
      INSTALL-EN.md
  2. 27 2
      INSTALL.md
  3. 6 3
      cmd
  4. 0 7
      docker-compose.yml
  5. 8 0
      docker/php.Dockerfile

+ 27 - 2
INSTALL-EN.md

@@ -59,12 +59,15 @@ LARAVELS_PROXY_URL=
 ./cmd build php
 ./cmd composer install
 ./cmd up -d
-./cmd art key:generate
-./cmd art migrate --seed
+./cmd artisan key:generate
+./cmd artisan migrate --seed
 ./cmd npm install
 ./cmd npm run prod
+./cmd supervisorctl restart all
 ```
 
+Installed, project url: ***http://IP:APP_PORT***.
+
 #### To stop the app server
 
 ```bash
@@ -77,6 +80,28 @@ LARAVELS_PROXY_URL=
 ./cmd start
 ```
 
+### Shortcuts for running command
+
+> You can use the following command to execute it
+
+```bash
+./cmd artisan "your command"    // To run a artisan command
+
+./cmd php "your command"   // To run a php command
+
+./cmd composer "your command"   // To run a composer command
+
+./cmd supervisorctl "your command"   // To run a supervisorctl command
+
+./cmd test "your command"   // To run a phpunit command
+
+./cmd npm "your command"    // To run a npm command
+
+./cmd yarn "your command"   // To run a yarn command
+
+./cmd mysql "your command"  // To run a mysql command
+```
+
 ## Setup (if you're not using docker)
 
 > Fork the repo if you are outside collaborator https://github.com/kuaifan/wookteam.

+ 27 - 2
INSTALL.md

@@ -59,10 +59,11 @@ LARAVELS_PROXY_URL=
 ./cmd build php
 ./cmd composer install
 ./cmd up -d
-./cmd art key:generate
-./cmd art migrate --seed
+./cmd artisan key:generate
+./cmd artisan migrate --seed
 ./cmd npm install
 ./cmd npm run prod
+./cmd supervisorctl restart all
 ```
 
 #### 停止服务
@@ -77,6 +78,30 @@ LARAVELS_PROXY_URL=
 ./cmd start
 ```
 
+到此安装完毕,项目地址为:***http://IP:APP_PORT***。
+
+### 运行命令的快捷方式
+
+> 你可以使用一下命令来执行
+
+```bash
+./cmd artisan "your command"    // 运行 artisan 命令
+
+./cmd php "your command"   // 运行 php 命令
+
+./cmd composer "your command"   // 运行 composer 命令
+
+./cmd supervisorctl "your command"   // 运行 supervisorctl 命令
+
+./cmd test "your command"   // 运行 phpunit 命令
+
+./cmd npm "your command"    // 运行 npm 命令
+
+./cmd yarn "your command"   // 运行 yarn 命令
+
+./cmd mysql "your command"  // 运行 mysql 命令
+```
+
 ## 安装设置(如果你没有使用docker)
 
 > Fork the repo if you are outside collaborator https://github.com/kuaifan/wookteam.

+ 6 - 3
cmd

@@ -3,7 +3,7 @@
 COMPOSE="docker-compose"
 
 if [ $# -gt 0 ];then
-    if [[ "$1" == "art" ]]; then
+    if [[ "$1" == "artisan" ]]; then
         shift 1
         $COMPOSE run --rm -w /var/www php php artisan "$@"
     elif [[ "$1" == "php" ]]; then
@@ -12,15 +12,18 @@ if [ $# -gt 0 ];then
     elif [[ "$1" == "composer" ]]; then
         shift 1
         $COMPOSE run --rm -w /var/www php composer "$@"
+    elif [[ "$1" == "supervisorctl" ]]; then
+        shift 1
+        $COMPOSE run --rm -w /var/www php supervisorctl "$@"
     elif [[ "$1" == "test" ]]; then
         shift 1
         $COMPOSE run --rm -w /var/www php ./vendor/bin/phpunit "$@"
     elif [[ "$1" == "npm" ]]; then
         shift 1
-        $COMPOSE run --rm -w /var/www nodejs npm "$@"
+        $COMPOSE run --rm -w /var/www php npm "$@"
     elif [[ "$1" == "yarn" ]]; then
         shift 1
-        $COMPOSE run --rm -w /var/www nodejs yarn "$@"
+        $COMPOSE run --rm -w /var/www php yarn "$@"
     elif [[ "$1" == "mysql" ]]; then
         shift 1
         $COMPOSE run --rm -w / mariadb mysql "$@"

+ 0 - 7
docker-compose.yml

@@ -38,10 +38,3 @@ services:
       - "MYSQL_USER=${DB_USERNAME}"
       - "MYSQL_PASSWORD=${DB_PASSWORD}"
     restart: always
-
-  nodejs:
-    hostname: nodejs
-    image: node:12.18.0
-    working_dir: /var/www
-    volumes:
-      - ./:/var/www

+ 8 - 0
docker/php.Dockerfile

@@ -13,6 +13,14 @@ RUN apt-get update \
         iputils-ping \
         vim \
         supervisor \
+        sudo \
+        curl \
+        dirmngr \
+        apt-transport-https \
+        lsb-release \
+        ca-certificates \
+        && curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
+        && apt-get -y install nodejs \
         && rm -r /var/lib/apt/lists/* \
         && docker-php-ext-configure gd \
         && docker-php-ext-install pdo_mysql gd pcntl zip