lilyhof/CLAS-basic-interaction-exercise4
0
1# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker2# you will also find guides on how best to write your Dockerfile3 4FROM python:3.105 6WORKDIR /code7 8COPY ./requirements.txt /code/requirements.txt9 10RUN pip install --no-cache-dir --upgrade pip11 12RUN --mount=type=secret,id=PIPLOC,mode=0444,required=true \13bash -c "PIPLOC=$(cat /run/secrets/PIPLOC); pip install --no-deps --no-cache-dir \${PIPLOC}"14 15RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt16 17# Set up a new user named "user" with user ID 100018RUN useradd -m -u 1000 user19 20# Switch to the "user" user21USER user22 23# Set home to the user's home directory24ENV HOME=/home/user \25 PATH=/home/user/.local/bin:$PATH26 27# Set the working directory to the user's home directory28WORKDIR $HOME/app29 30# Copy the current directory contents into the container at $HOME/app setting the owner to the user31COPY --chown=user . $HOME/app32 33CMD ["python", "app.py"]