# FROM ubuntu:22.04 | |
# # Set the timezone of the container | |
# ENV CONTAINER_TIMEZONE=UTC | |
# RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone | |
# # Create directory for the application | |
# RUN mkdir -p /home/recognito_id | |
# # Set the working directory | |
# WORKDIR /home/recognito_id | |
# # Copy the application files into the container | |
# COPY . . | |
# ADD https://huggingface.co/recognito/ID-Document-Liveness-Detection-Models/resolve/main/model.zip . | |
# # Make the scripts executable | |
# RUN chmod +x install.sh run_demo.sh | |
# # Run the install.sh script to perform any installation tasks | |
# RUN apt-get update && apt-get install -y sudo unzip | |
# RUN unzip ./model.zip -d ./id_live/engine/ && rm ./model.zip | |
# RUN ./install.sh | |
# RUN chmod -R 777 . | |
# # Expose port 8000(flask), 7860(gradio) | |
# EXPOSE 8000 7860 | |
# # Set the default command to run the application | |
# ENTRYPOINT ["./run_demo.sh"] | |
FROM ubuntu:22.04 | |
RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone | |
RUN apt-get update && \ | |
apt-get install -y binutils python3 python3-pip python3-opencv && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
WORKDIR /app | |
COPY --chown=user . . | |
COPY --chown=user ./id_live/dependency/* /usr/lib | |
ADD https://huggingface.co/recognito/ID-Document-Liveness-Detection-Models/resolve/main/model.tar.xz . | |
RUN tar -xvJf ./model.tar.xz -C ./id_live/engine/ && rm ./model.tar.xz | |
RUN chmod -R 777 . | |
RUN pip3 install gradio opencv-python numpy | |
EXPOSE 9000 7860 | |
ENTRYPOINT ["./run_demo.sh"] | |