Update Dockerfile
Browse files- Dockerfile +2 -54
Dockerfile
CHANGED
|
@@ -1,55 +1,3 @@
|
|
| 1 |
# ============ Source Stage ============
|
| 2 |
-
FROM
|
| 3 |
-
|
| 4 |
-
WORKDIR /repo
|
| 5 |
-
RUN git clone --recurse-submodules --depth=1 \
|
| 6 |
-
https://github.com/liuzhao1225/YouDub-webui.git . \
|
| 7 |
-
&& rm -rf .git
|
| 8 |
-
|
| 9 |
-
# ============ Frontend Build Stage ============
|
| 10 |
-
FROM node:20-slim AS frontend-builder
|
| 11 |
-
|
| 12 |
-
WORKDIR /build
|
| 13 |
-
COPY --from=source /repo/apps/web/ .
|
| 14 |
-
RUN npm ci && npm run build
|
| 15 |
-
|
| 16 |
-
# ============ Runtime Stage ============
|
| 17 |
-
FROM python:3.12-slim-bookworm
|
| 18 |
-
|
| 19 |
-
WORKDIR /app
|
| 20 |
-
|
| 21 |
-
# Install system runtime deps
|
| 22 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 23 |
-
ffmpeg curl ca-certificates build-essential \
|
| 24 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
-
|
| 26 |
-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 27 |
-
&& apt-get install -y nodejs \
|
| 28 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 29 |
-
|
| 30 |
-
# Copy entire source tree
|
| 31 |
-
COPY --from=source /repo/ .
|
| 32 |
-
|
| 33 |
-
# Install Python dependencies
|
| 34 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 35 |
-
|
| 36 |
-
# Overlay built frontend artifacts
|
| 37 |
-
COPY --from=frontend-builder /build/.next apps/web/.next
|
| 38 |
-
COPY --from=frontend-builder /build/node_modules apps/web/node_modules
|
| 39 |
-
|
| 40 |
-
# Create runtime data directories
|
| 41 |
-
RUN mkdir -p data workfolder
|
| 42 |
-
|
| 43 |
-
# Install entrypoint
|
| 44 |
-
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
| 45 |
-
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
| 46 |
-
|
| 47 |
-
EXPOSE 7860
|
| 48 |
-
|
| 49 |
-
ENV DEVICE=cpu
|
| 50 |
-
ENV WORKFOLDER=./workfolder
|
| 51 |
-
ENV MODEL_CACHE_DIR=./data/modelscope
|
| 52 |
-
ENV BACKEND_PORT=8000
|
| 53 |
-
ENV FRONTEND_PORT=7860
|
| 54 |
-
|
| 55 |
-
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
| 1 |
# ============ Source Stage ============
|
| 2 |
+
FROM ghcr.io/smanx/cloudflare-workers
|
| 3 |
+
ENV PORT=7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|