2026-08-15 14:21:59 +03:00
|
|
|
FROM node:22-alpine AS admin-build
|
|
|
|
|
WORKDIR /admin
|
|
|
|
|
COPY admin/package*.json ./
|
|
|
|
|
RUN npm ci --no-audit --no-fund
|
|
|
|
|
COPY admin ./
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
FROM python:3.12-slim AS python-wheels
|
|
|
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt requirements-yt-dlp.txt ./
|
|
|
|
|
RUN python -m pip install --no-cache-dir --upgrade pip wheel \
|
|
|
|
|
&& python -m pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt -r requirements-yt-dlp.txt
|
|
|
|
|
|
|
|
|
|
FROM python:3.12-slim AS runtime
|
2026-06-27 14:07:10 +03:00
|
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
RUN apt-get update \
|
2026-09-02 19:46:34 +03:00
|
|
|
&& apt-get install -y --no-install-recommends ffmpeg ca-certificates libgomp1 nodejs \
|
2026-06-27 14:07:10 +03:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-08-15 14:21:59 +03:00
|
|
|
COPY requirements.txt requirements-yt-dlp.txt ./
|
|
|
|
|
COPY --from=python-wheels /wheels /wheels
|
|
|
|
|
RUN python -m pip install --no-cache-dir --no-index --find-links=/wheels -r requirements.txt -r requirements-yt-dlp.txt \
|
|
|
|
|
&& rm -rf /wheels
|
2026-06-27 14:07:10 +03:00
|
|
|
|
|
|
|
|
COPY app ./app
|
2026-08-15 14:21:59 +03:00
|
|
|
COPY --from=admin-build /admin/dist ./admin_dist
|
2026-06-27 14:07:10 +03:00
|
|
|
|
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|