This commit is contained in:
eric
2026-03-28 02:39:29 -05:00
parent 243b9d7acb
commit 4b3c6cbee4
23 changed files with 1468 additions and 173 deletions

View File

@@ -1,19 +1,28 @@
FROM python:3.11-slim
# 生产镜像ffmpeg + 多阶段构建 Next 静态页 + Python API默认端口 8101减少与同机 SRS/代理 冲突)
# docker compose up --build
FROM node:20-bookworm-slim AS console
WORKDIR /src/web-console
COPY web-console/package.json web-console/package-lock.json ./
RUN npm ci
COPY web-console/ ./
RUN npm run build
FROM python:3.12-slim-bookworm
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PORT=8101
COPY . /app
RUN apt-get update && \
apt-get install -y curl gnupg && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& ffmpeg -version
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && \
apt-get install -y ffmpeg tzdata && \
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
COPY . .
COPY --from=console /src/web-console/out ./web-console/out
CMD ["python", "main.py"]
EXPOSE 8101
CMD ["sh", "-c", "exec python -m uvicorn web:app --host 0.0.0.0 --port ${PORT}"]