Spaces:
Runtime error
Runtime error
| FROM ubuntu:22.04 | |
| # Install necessary packages | |
| RUN apt-get update && apt-get install -y curl git python3 python3-pip && \ | |
| curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | |
| apt-get install -y git-lfs | |
| # Install Python dependencies | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Create a non-root user and set writable directories for Matplotlib and Transformers | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| MPLCONFIGDIR=$HOME/.config/matplotlib \ | |
| TRANSFORMERS_CACHE=$HOME/.cache/huggingface/hub | |
| # Prepare application directory | |
| WORKDIR $HOME/app | |
| COPY --chown=user . $HOME/app | |
| # Setup application environment | |
| WORKDIR /code | |
| RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/ | |
| COPY . . | |
| CMD ["python3", "app.py"] | |