|
FROM pytorch/pytorch:latest |
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
WORKDIR /app |
|
|
|
RUN apt-get update |
|
RUN DEBIAN_FRONTEND=noninteractive TZ=asia/shanghai apt-get -y install tzdata |
|
|
|
ENV TRANSFORMERS_CACHE=/app/cache |
|
ENV DEEPL_AUTH_KEY="6e4907cd-8926-42e7-aa5d-7561363c82b1:fx" |
|
ENV OPENAI_API_KEY="sk-yuBWvBk2lTQoJFYP24A03515D46041429f907dE81cC3F04e" |
|
ENV OPENAI_HTTP_PROXY="https://www.ygxdapi.top" |
|
RUN mkdir -p /app/cache |
|
|
|
RUN apt-get install -y git g++ ffmpeg libsm6 libxext6 libvulkan-dev |
|
|
|
|
|
|
|
|
|
COPY --chown=user requirements.txt /app/requirements.txt |
|
|
|
RUN pip install -r /app/requirements.txt |
|
RUN pip install torchvision --force-reinstall |
|
RUN pip install "numpy<2.0" |
|
|
|
|
|
RUN apt-get remove -y g++ && \ |
|
apt-get autoremove -y |
|
|
|
|
|
COPY --chown=user . /app |
|
|
|
|
|
RUN python -u docker_prepare.py |
|
|
|
RUN rm -rf /tmp |
|
|
|
|
|
ENV PYTHONPATH="${PYTHONPATH}:/app" |
|
|
|
WORKDIR /app |
|
RUN mkdir -p /app/result && chmod 777 /app/result |
|
RUN mkdir -p /app/models/translators && chmod 777 /app/models/translators |
|
RUN mkdir -p /app/models/upscaling && chmod 777 /app/models/upscaling |
|
RUN mkdir -p /app/cache/models && chmod 777 /app/cache/models |
|
RUN mkdir -p /app/cache/.locks && chmod 777 /app/cache/.locks |
|
RUN mkdir -p /app/cache/models--kha-white--manga-ocr-base && chmod 777 /app/cache/models--kha-white--manga-ocr-base |
|
RUN mkdir -p /app && chmod 777 /app |
|
|
|
ENTRYPOINT ["python", "-m", "manga_translator", "-v", "--mode", "web", "--host", "0.0.0.0", "--port", "7860", "--font-size", "28", "--font-size-offset", "5", "--unclip-ratio", "1.1", "--det-invert"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|