Spaces:
Runtime error
Runtime error
File size: 1,136 Bytes
f84b5cd d9472e5 f84b5cd 4074243 f84b5cd d9472e5 f84b5cd 0fedaf1 f84b5cd 0fedaf1 f96091f f84b5cd d9472e5 f84b5cd f96091f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
FROM python:3.10
# Install necessary libraries
RUN apt-get update && apt-get install -y \
git \
cmake \
libopencv-dev
WORKDIR /code
# Copy requirements and install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Clone and build the project
RUN git clone https://github.com/Truoji/tengine-lite-yolov5s-tt100k && \
cd tengine-lite-yolov5s-tt100k && \
mkdir build && \
cd build && \
cmake .. && \
make
# Set LD_LIBRARY_PATH to include third_party libraries
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/app/tengine-lite-yolov5s-tt100k/third_party/
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
# Run the project
CMD ["python", "gradio.app.py"] |