Compare commits
10 Commits
d77fa690bb
...
76e96d4af1
Author | SHA1 | Date |
---|---|---|
|
76e96d4af1 | |
|
064c6c3b83 | |
|
086601c664 | |
|
4bb7364259 | |
|
97534b46b2 | |
|
6628db5670 | |
|
19ce565128 | |
|
14b4a7a088 | |
|
7c483f860f | |
|
5938b44e28 |
|
@ -1,6 +1,7 @@
|
||||||
name: Deploy to Test
|
name: Deploy to Test
|
||||||
on:
|
on:
|
||||||
push
|
push:
|
||||||
|
branches: [dev]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -68,6 +69,7 @@ jobs:
|
||||||
done
|
done
|
||||||
|
|
||||||
docker exec "${COMPOSE_PROJECT}-php-1" composer install --no-dev --optimize-autoloader
|
docker exec "${COMPOSE_PROJECT}-php-1" composer install --no-dev --optimize-autoloader
|
||||||
|
docker exec "${COMPOSE_PROJECT}-php-1" php artisan key:generate
|
||||||
docker exec "${COMPOSE_PROJECT}-php-1" php artisan config:cache
|
docker exec "${COMPOSE_PROJECT}-php-1" php artisan config:cache
|
||||||
docker exec "${COMPOSE_PROJECT}-nginx-1" nginx -s reload
|
docker exec "${COMPOSE_PROJECT}-nginx-1" nginx -s reload
|
||||||
EOF
|
EOF
|
||||||
|
|
14
dockerfile
14
dockerfile
|
@ -2,7 +2,7 @@ FROM php:7.3-fpm
|
||||||
|
|
||||||
# 替换为清华大学镜像源(Debian 10 Buster)
|
# 替换为清华大学镜像源(Debian 10 Buster)
|
||||||
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
||||||
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
|
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
|
||||||
|
|
||||||
# 安装系统依赖和扩展
|
# 安装系统依赖和扩展
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
@ -14,3 +14,15 @@ RUN apt-get update && apt-get install -y \
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- \
|
RUN curl -sS https://getcomposer.org/installer | php -- \
|
||||||
--install-dir=/usr/local/bin \
|
--install-dir=/usr/local/bin \
|
||||||
--filename=composer
|
--filename=composer
|
||||||
|
|
||||||
|
# 创建非 root 用户(推荐与宿主机用户 UID/GID 一致)
|
||||||
|
ARG USER_ID=1003 # 宿主机 deploy-user 的 UID
|
||||||
|
ARG GROUP_ID=1003 # 宿主机 deploy-user 的 GID
|
||||||
|
RUN groupadd -g ${GROUP_ID} appuser \
|
||||||
|
&& useradd -u ${USER_ID} -g appuser -m -d /home/appuser -s /bin/bash appuser
|
||||||
|
|
||||||
|
# 设置工作目录权限
|
||||||
|
RUN chown -R appuser:appuser /var/www/html
|
||||||
|
|
||||||
|
# 切换到非 root 用户
|
||||||
|
USER appuser
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
* @package Laravel
|
* @package Laravel
|
||||||
* @author Taylor Otwell <taylor@laravel.com>
|
* @author Taylor Otwell <taylor@laravel.com>
|
||||||
*/
|
*/
|
||||||
echo '123';
|
|
||||||
exit();
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -16,3 +16,7 @@ use Illuminate\Http\Request;
|
||||||
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/test', function () {
|
||||||
|
return ["msg" => "success", "data" => [], "status" => 0];
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue