Update Dockerfile
This commit is contained in:
48
Dockerfile
48
Dockerfile
@@ -1,23 +1,41 @@
|
|||||||
|
# Stage 1: Builder
|
||||||
|
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04 as builder
|
||||||
|
|
||||||
|
WORKDIR /subgen
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
python3 \
|
||||||
|
python3-pip \
|
||||||
|
ffmpeg \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copy requirements and install Python dependencies
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy application code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Stage 2: Runtime
|
||||||
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
|
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
|
||||||
|
|
||||||
WORKDIR /subgen
|
WORKDIR /subgen
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/McCloudS/subgen/main/requirements.txt /subgen/requirements.txt
|
# Copy necessary files from the builder stage
|
||||||
|
COPY --from=builder /subgen/requirements.txt .
|
||||||
|
COPY --from=builder /subgen/launcher.py .
|
||||||
|
COPY --from=builder /subgen/subgen.py .
|
||||||
|
COPY --from=builder /subgen/language_code.py .
|
||||||
|
COPY --from=builder /user/local /usr/local
|
||||||
|
|
||||||
RUN apt-get update \
|
# Install runtime dependencies
|
||||||
&& apt-get install -y \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
python3 \
|
ffmpeg \
|
||||||
python3-pip \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
ffmpeg \
|
|
||||||
git \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& pip3 install -r requirements.txt
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/McCloudS/subgen/main/launcher.py /subgen/launcher.py
|
# Set command to run the application
|
||||||
ADD https://raw.githubusercontent.com/McCloudS/subgen/main/subgen.py /subgen/subgen.py
|
CMD ["python3", "launcher.py"]
|
||||||
ADD https://raw.githubusercontent.com/McCloudS/subgen/main/language_code.py /subgen/language_code.py
|
|
||||||
|
|
||||||
CMD [ "bash", "-c", "python3 -u launcher.py" ]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user