|
|
|
FROM python:3.8 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
build-essential \ |
|
cmake \ |
|
curl \ |
|
ca-certificates \ |
|
gcc \ |
|
git \ |
|
git-lfs \ |
|
wget \ |
|
libpq-dev \ |
|
libsndfile1-dev \ |
|
libgl1 \ |
|
unzip \ |
|
libjpeg-dev \ |
|
libpng-dev \ |
|
libgomp1 \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& apt-get clean |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN mkdir -p /app/.streamlit && \ |
|
echo "[server]\nenableXsrfProtection = false\nenableCORS = false" > /app/.streamlit/config.toml |
|
|
|
|
|
RUN git clone https://github.com/nguyen-brat/text-remove.git /app/text-remove |
|
|
|
|
|
WORKDIR /app/text-remove |
|
|
|
RUN mkdir -p /app/text-remove/.streamlit && \ |
|
echo "[server]\nenableXsrfProtection = false\nenableCORS = false" > /app/text-remove/.streamlit/config.toml |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
WORKDIR /app/text-remove/CRAFT-pytorch |
|
RUN wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1Jk4eGD7crsqCCg9C9VjCLkMN3ze8kutZ' -O "craft_mlt_25k.pth" |
|
RUN pip install gdown |
|
RUN gdown 1XSaFwBkOaFOdtk4Ane3DFyJGPRw6v5bO |
|
|
|
|
|
WORKDIR /app/text-remove/lama |
|
RUN curl -LJO https://huggingface.co/smartywu/big-lama/resolve/main/big-lama.zip |
|
RUN unzip big-lama.zip |
|
|
|
|
|
WORKDIR /app/text-remove |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
ENTRYPOINT ["streamlit", "run"] |
|
CMD ["app.py", "--server.port=7860"] |
|
|
|
|