CI/CD Pipeline / test-build-boot (push) Successful in 51s
CI/CD Pipeline / build-push (ljwx-boot) (push) Failing after 8s
CI/CD Pipeline / build-pr (ljwx-admin) (push) Has been skipped
CI/CD Pipeline / build-pr (ljwx-bigscreen) (push) Has been skipped
CI/CD Pipeline / build-push (ljwx-admin) (push) Failing after 15s
CI/CD Pipeline / build-pr (ljwx-boot) (push) Has been skipped
CI/CD Pipeline / build-push (ljwx-bigscreen) (push) Successful in 42s
CI/CD Pipeline / update-deploy (ljwx-admin) (push) Has been skipped
CI/CD Pipeline / update-deploy (ljwx-bigscreen) (push) Has been skipped
CI/CD Pipeline / update-deploy (ljwx-boot) (push) Has been skipped
根据 Harbor 项目实际镜像路径更新: 1. nginx 镜像: - 错误: harbor.omniverseai.net/dockerhub/library/nginx:alpine - 正确: harbor.omniverseai.net/library/nginx:alpine 2. python 镜像: - 错误: harbor.omniverseai.net/library/python:3.12-slim - 正确: harbor.omniverseai.net/library/python3.11-alpine 3. 系统依赖更新(切换到 Alpine Linux): - 包管理器: apt-get → apk - MySQL 客户端: default-libmysqlclient-dev → mariadb-dev + mariadb-connector-c - 新增依赖: musl-dev, linux-headers (Alpine 编译需要) Harbor 镜像位置: - Project 1 repositories: https://192.168.1.83/harbor/projects/1/repositories - library/nginx:alpine - library/python3.11-alpine 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
48 lines
1.2 KiB
Docker
48 lines
1.2 KiB
Docker
# =============================================================================
|
|
# LJWX BigScreen - Production Dockerfile
|
|
# =============================================================================
|
|
FROM harbor.omniverseai.net/library/python3.11-alpine
|
|
|
|
# 设置时区
|
|
ENV TZ=Asia/Shanghai
|
|
RUN apk add --no-cache tzdata && \
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
|
|
echo $TZ > /etc/timezone
|
|
|
|
# 设置工作目录
|
|
WORKDIR /app
|
|
|
|
# 安装系统依赖(Alpine 版本)
|
|
RUN apk add --no-cache \
|
|
gcc \
|
|
musl-dev \
|
|
linux-headers \
|
|
mariadb-dev \
|
|
mariadb-connector-c
|
|
|
|
# 复制依赖文件
|
|
COPY requirements.txt .
|
|
|
|
# 安装 Python 依赖
|
|
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
# 复制应用代码
|
|
COPY . .
|
|
|
|
# 设置环境变量
|
|
ENV FLASK_ENV=production \
|
|
APP_HOST=0.0.0.0 \
|
|
APP_PORT=5225 \
|
|
DEBUG=False \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
# 暴露端口
|
|
EXPOSE 5225
|
|
|
|
# 健康检查
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD python -c "import requests; requests.get('http://localhost:5225/health', timeout=5)" || exit 1
|
|
|
|
# 启动应用
|
|
CMD ["python", "run.py"]
|