| # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| # you will also find guides on how best to write your Dockerfile | |
| FROM ghcr.io/cmu-sei/pharos:pichash-work | |
| WORKDIR /code | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN apt-get -y update && apt-get -y install python3-pip python-is-python3 | |
| # Switch to the "user" user | |
| USER ubuntu | |
| # Set home to the user's home directory | |
| ENV HOME=/home/ubuntu \ | |
| PATH=/home/ubuntu/.local/bin:$PATH | |
| RUN pip install --break-system-packages --no-cache-dir --upgrade setuptools pip | |
| RUN pip install --break-system-packages --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Set the working directory to the user's home directory | |
| WORKDIR $HOME/app | |
| # Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
| COPY --chown=ubuntu . $HOME/app | |
| CMD ["python", "main.py"] |