Compare commits

..

6 Commits
dev ... main

Author SHA1 Message Date
liubocheng 43de1211b2 main:修改地址
Deploy to Test / deploy (push) Successful in 49s Details
2025-04-06 10:48:07 +08:00
liubocheng 46992b4f17 main:修改权限组
Deploy to Test / deploy (push) Successful in 31s Details
2025-04-05 07:51:43 +08:00
liubocheng da37a4abc0 增加日志
Deploy to Test / deploy (push) Has been cancelled Details
2025-04-05 07:01:20 +08:00
liubocheng e96d4fec18 增加日志
Deploy to Test / deploy (push) Failing after 16s Details
2025-04-05 06:59:25 +08:00
liubocheng bc8e59c70c main:修改工作流分支
Deploy to Test / deploy (push) Has been cancelled Details
2025-04-04 22:09:47 +08:00
liubocheng ecc2f51722 dev:参数从docker-compose传递到dockerfile 2025-04-04 22:07:29 +08:00
4 changed files with 22 additions and 11 deletions

View File

@ -1,7 +1,7 @@
name: Deploy to Test name: Deploy to Test
on: on:
push: push:
branches: [dev] branches: [main]
jobs: jobs:
deploy: deploy:
@ -10,17 +10,22 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: https://gitea.com/actions/checkout@v4
with: with:
# 指定分支、标签或提交哈希 # 指定分支、标签或提交哈希
ref: dev ref: main
# 拉取深度(节省时间与带宽) # 拉取深度(节省时间与带宽)
fetch-depth: 0 # 0 表示拉取完整的历史 fetch-depth: 0 # 0 表示拉取完整的历史
- name: Replace Debian APT sources - name: Replace Debian APT sources
run: | run: |
sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \ tee /etc/apt/sources.list <<EOF
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list # 清华大学 Debian 11 Bullseye 镜像
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
EOF
- name: Install SSH tools - name: Install SSH tools
run: | run: |

View File

@ -1,7 +1,11 @@
version: '3.8' version: '3.8'
services: services:
php: php:
build: . # 指向 Dockerfile 目录 build:
context: .
args:
USER_ID: "1001"
GROUP_ID: "1001"
volumes: volumes:
- /data/laravel_test:/var/www/html - /data/laravel_test:/var/www/html
working_dir: /var/www/html working_dir: /var/www/html

View File

@ -1,4 +1,8 @@
FROM php:7.3-fpm FROM php:7.3-fpm
ARG USER_ID
ARG GROUP_ID
RUN echo "USER_ID: ${USER_ID}"
# 替换为清华大学镜像源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 \
@ -16,8 +20,6 @@ RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer --filename=composer
# 创建非 root 用户(推荐与宿主机用户 UID/GID 一致) # 创建非 root 用户(推荐与宿主机用户 UID/GID 一致)
ARG USER_ID=1001 # 宿主机 deploy-user 的 UID
ARG GROUP_ID=1001 # 宿主机 deploy-user 的 GID
RUN groupadd -g ${GROUP_ID} appuser \ RUN groupadd -g ${GROUP_ID} appuser \
&& useradd -u ${USER_ID} -g appuser -m -d /home/appuser -s /bin/bash appuser && useradd -u ${USER_ID} -g appuser -m -d /home/appuser -s /bin/bash appuser

View File

@ -18,5 +18,5 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
}); });
Route::get('/test', function () { Route::get('/test', function () {
return ["msg" => "success", "data" => [], "status" => 200]; return ["msg" => "success", "data" => [], "status" => 0];
}); });