an alternative version of dockerfile only use for debugging
This commit is contained in:
parent
8899b9755a
commit
1fea3c5b74
@ -1,62 +1,35 @@
|
|||||||
FROM python:3.10.10-buster AS builder
|
FROM python:3.10.10-buster
|
||||||
ARG UID=1000
|
RUN apt-get update \
|
||||||
ARG GID=1000
|
&& apt-get install -y bash gettext poppler-utils ffmpeg libsm6 libxext6 wget
|
||||||
ARG USERNAME=container-user
|
|
||||||
RUN groupadd --gid ${GID} ${USERNAME} \
|
|
||||||
&& useradd --uid ${UID} --gid ${GID} -m ${USERNAME} \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y sudo bash gettext poppler-utils \
|
|
||||||
&& echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
|
|
||||||
&& chmod 0440 /etc/sudoers.d/${USERNAME}
|
|
||||||
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 wget -y
|
|
||||||
RUN yes | apt install postgresql gcc musl-dev
|
RUN yes | apt install postgresql gcc musl-dev
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
RUN pip install uvicorn gunicorn Celery
|
RUN pip install uvicorn gunicorn Celery
|
||||||
|
|
||||||
# For intergration with sdskvu
|
# For intergration with sdskvu
|
||||||
RUN pip install pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116
|
COPY torch-1.13.1+cu116-cp310-cp310-linux_x86_64.whl .
|
||||||
|
RUN pip install torch-1.13.1+cu116-cp310-cp310-linux_x86_64.whl --no-cache-dir
|
||||||
RUN pip install -U openmim==0.3.7 --no-cache-dir
|
RUN pip install -U openmim==0.3.7 --no-cache-dir
|
||||||
RUN mim install mmcv-full==1.7.2
|
RUN mim install mmcv-full==1.7.2
|
||||||
# RUN pip install fastdeploy-gpu-python==1.0.7 -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html --no-cache-dir
|
COPY fastdeploy_gpu_python-1.0.7-cp310-cp310-manylinux1_x86_64.whl .
|
||||||
RUN wget https://bj.bcebos.com/fastdeploy/release/wheels/fastdeploy_python-1.0.7-cp310-cp310-manylinux1_x86_64.whl \
|
RUN pip install fastdeploy_python-1.0.7-cp310-cp310-manylinux1_x86_64.whl --no-cache-dir
|
||||||
&& pip install fastdeploy_python-1.0.7-cp310-cp310-manylinux1_x86_64.whl --no-cache-dir \
|
|
||||||
&& rm fastdeploy_python-1.0.7-cp310-cp310-manylinux1_x86_64.whl
|
|
||||||
# End intergration with sdskvu
|
# End intergration with sdskvu
|
||||||
|
|
||||||
USER ${UID}
|
COPY requirements.txt /app
|
||||||
ADD --chown=${UID}:${GID} fwd /app
|
RUN pip install -r /app/requirements.txt --no-cache-dir
|
||||||
COPY --chown=${UID}:${GID} requirements.txt /app
|
|
||||||
|
|
||||||
WORKDIR /app
|
COPY fwd_api/utils/sdsvkvu ./sdsvkvu
|
||||||
RUN pip install -r requirements.txt --no-cache-dir
|
RUN cd sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsv_dewarp && pip3 install -v -e . --no-cache-dir
|
||||||
|
RUN cd sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsvtd && pip3 install -v -e . --no-cache-dir
|
||||||
COPY --chown=${UID}:${GID} . /app
|
RUN cd sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsvtr && pip3 install -v -e . --no-cache-dir
|
||||||
|
RUN cd sdsvkvu && pip3 install -v -e . --no-cache-dir
|
||||||
RUN cd /app/fwd_api/utils/sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsv_dewarp && pip3 install -v -e . --no-cache-dir
|
|
||||||
RUN cd /app/fwd_api/utils/sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsvtd && pip3 install -v -e . --no-cache-dir
|
|
||||||
RUN cd /app/fwd_api/utils/sdsvkvu/sdsvkvu/externals/sdsvocr/sdsvocr/externals/sdsvtr && pip3 install -v -e . --no-cache-dir
|
|
||||||
RUN cd /app/fwd_api/utils/sdsvkvu && pip3 install -v -e . --no-cache-dir
|
|
||||||
|
|
||||||
# For intergration with sdskvu
|
# For intergration with sdskvu
|
||||||
# RUN python -m pip install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html --no-cache-dir
|
COPY paddlepaddle_gpu-2.4.2.post116-cp310-cp310-linux_x86_64.whl .
|
||||||
RUN wget https://paddle-wheel.bj.bcebos.com/2.4.2/linux/linux-gpu-cuda11.6-cudnn8.4.0-mkl-gcc8.2-avx/paddlepaddle_gpu-2.4.2.post116-cp310-cp310-linux_x86_64.whl \
|
RUN pip install /app/paddlepaddle_gpu-2.4.2.post116-cp310-cp310-linux_x86_64.whl --no-cache-dir
|
||||||
&& pip install paddlepaddle_gpu-2.4.2.post116-cp310-cp310-linux_x86_64.whl --no-cache-dir \
|
|
||||||
&& rm paddlepaddle_gpu-2.4.2.post116-cp310-cp310-linux_x86_64.whl
|
|
||||||
|
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --chown=${UID}:${GID} . /app
|
||||||
ENV TZ="Asia/Ho_Chi_Minh"
|
ENV TZ="Asia/Ho_Chi_Minh"
|
||||||
|
|
||||||
|
CMD ["bash"]
|
||||||
# FROM cope2n-api-base AS builder
|
|
||||||
# ARG UID=1000
|
|
||||||
# ARG GID=1000
|
|
||||||
# ARG USERNAME=container-user
|
|
||||||
|
|
||||||
# # Create a new user
|
|
||||||
# RUN groupadd --gid ${GID} ${USERNAME} \
|
|
||||||
# && useradd --uid ${UID} --gid ${GID} -m ${USERNAME} \
|
|
||||||
# && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
|
|
||||||
# && chmod 0440 /etc/sudoers.d/${USERNAME}
|
|
||||||
|
|
||||||
# WORKDIR /app
|
|
||||||
# COPY --chown=${UID}:${GID} . /app
|
|
Loading…
Reference in New Issue
Block a user