mirror of
https://github.com/rnvm9wjdtj-bot/myaps_api.git
synced 2026-06-02 05:54:40 +00:00
ci(build): add aliyun mirror switch and fix redis command
1. 为Dockerfile添加USE_ALIYUN_MIRROR构建参数,支持切换使用阿里云镜像源 2. 移除docker-compose.yml中redis的动态密码参数配置 3. 在CI工作流中默认关闭阿里云镜像源
This commit is contained in:
@@ -274,6 +274,7 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: USE_ALIYUN_MIRROR=false
|
||||
|
||||
- name: 添加架构标签
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
# 构建阶段
|
||||
FROM python:3.12-slim AS builder
|
||||
|
||||
ARG USE_ALIYUN_MIRROR=false
|
||||
RUN if [ "$USE_ALIYUN_MIRROR" = "true" ]; then \
|
||||
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
|
||||
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list 2>/dev/null || true; \
|
||||
fi
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ services:
|
||||
network_mode: host
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
|
||||
command: redis-server --appendonly yes
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
|
||||
Reference in New Issue
Block a user