fix:检查版本升级导致的环境报错
This commit is contained in:
@@ -17,11 +17,14 @@ WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
PYTHONUNBUFFERED=1 \
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# Alpine 使用国内镜像,加速 apk 安装(python3/py3-pip)
|
||||
# Alpine 使用国内镜像,加速 apk 安装(python3/py3-pip)并设置时区为 Asia/Shanghai(与宿主机保持一致)
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache python3 py3-pip
|
||||
&& apk add --no-cache python3 py3-pip tzdata \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
@@ -3,11 +3,16 @@ FROM docker.m.daocloud.io/library/python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
PYTHONUNBUFFERED=1 \
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
COPY backend/requirements.txt .
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends tzdata \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||
&& pip install --no-cache-dir -r requirements.txt \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY backend ./backend
|
||||
|
||||
|
||||
@@ -808,7 +808,8 @@
|
||||
|
||||
async function checkHealth() {
|
||||
try {
|
||||
const res = await fetch('/health', { cache: 'no-store' });
|
||||
// 通过 /api/ws-status 检测后端是否可用(同时避免某些部署环境未透出 /health)
|
||||
const res = await fetch('/api/ws-status', { cache: 'no-store' });
|
||||
if (!res.ok) throw new Error('status ' + res.status);
|
||||
const data = await res.json().catch(() => ({}));
|
||||
$('health-dot').style.background = '#22c55e';
|
||||
|
||||
Reference in New Issue
Block a user