FROM python:3.10 AS builder # FROM python:3.10 WORKDIR /code # WORKDIR /home/user/app # COPY ./requirements.txt /code/requirements.txt # COPY . /code RUN apt-get update && \ apt-get install -y \ build-essential \ cmake \ libopenblas-dev \ liblapack-dev \ libomp-dev RUN apt-get install -y git # RUN git clone https://github.com/your-username/your-repository.git . RUN git clone https://albasaco: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@huggingface.co/spaces/createsafe/yachtiocraft WORKDIR /code/yachtiocraft RUN git submodule update --init --recursive # RUN git submodule update --init # RUN git submodule update --recursive # Stage 2 FROM python:3.10 # WORKDIR /home/user/app # WORKDIR /code WORKDIR /code/yachtiocraft # Copy files from the builder stage # COPY --from=builder /home/user/app /home/user/app # COPY --from=builder /code/yachtiocraft /code/yachtiocraft # COPY ./requirements.txt /home/user/app/requirements.txt COPY requirements.txt . # WORKDIR /code/yachtiocraft RUN pip install torch RUN pip install wheel RUN pip install --no-cache-dir --upgrade xformers==0.0.12 # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt RUN python -m pip install --no-cache-dir --upgrade -r 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 # Copy the current directory contents into the container at $HOME/app setting the owner to the user COPY --chown=user . $HOME/app CMD ["python", "app.py"]