feat: 修改dockerfile
center / deploy (push) Successful in 41s

This commit is contained in:
2026-10-04 06:38:39 -07:00
parent 6eee87f7c0
commit 313e9f618c
2 changed files with 10 additions and 1 deletions
+7
View File
@@ -15,6 +15,7 @@ env:
HOST_PORT: 22788
CONTAINER_PORT: 8100
ENV_FILE: /app/center/.env
LOG_DIR: /app/center/logs
DOCKER_BUILDKIT: '0'
jobs:
@@ -51,6 +52,11 @@ jobs:
exit 1
}
- name: Prepare log directory
run: |
# 容器以 uid 10001 运行,宿主机日志目录需要归其所有
docker run --rm -v "$(dirname "$LOG_DIR"):/data" alpine sh -c "mkdir -p /data/$(basename "$LOG_DIR") && chown 10001:10001 /data/$(basename "$LOG_DIR")"
- name: Build application image
run: |
STEP_START=$(date +%s)
@@ -85,6 +91,7 @@ jobs:
--name $IMAGE_NAME \
-p 127.0.0.1:$HOST_PORT:$CONTAINER_PORT \
-v "$ENV_FILE:/app/.env:ro" \
-v "$LOG_DIR:/app/logs" \
-e TZ=Asia/Shanghai \
--restart unless-stopped \
$IMAGE_NAME:latest
+3 -1
View File
@@ -19,7 +19,9 @@ ENV PATH="/app/.venv/bin:$PATH" \
WORKDIR /app
RUN useradd --system --no-create-home --uid 10001 center
RUN useradd --system --no-create-home --uid 10001 center \
&& mkdir -p /app/logs \
&& chown center:center /app/logs
COPY --from=builder /app/.venv /app/.venv
COPY alembic.ini ./