diff --git a/Dockerfile b/Dockerfile index 6467cdf..aa06d66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Start from the ROCm base image -FROM rocm/rocm-terminal:5.4.2 +# Start from the latest ROCm base image +FROM rocm/dev-ubuntu-22.04:6.0-complete # Set environment variables ENV DEBIAN_FRONTEND=noninteractive @@ -12,26 +12,25 @@ RUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/* -# Set the working directory in the container -WORKDIR /app +# Set up a new user +RUN useradd -m -s /bin/bash user +USER user +WORKDIR /home/user/app -# Copy the requirements file into the container -COPY requirements.txt . +# Set up Python environment +ENV PATH="/home/user/.local/bin:${PATH}" +RUN python3 -m pip install --user --upgrade pip -# Install Python dependencies -RUN pip3 install --no-cache-dir -r requirements.txt +COPY --chown=user:user requirements.txt . -# Copy the application code -COPY src /app/src -COPY examples /app/examples +RUN pip install --user --no-cache-dir -r requirements.txt -# Create a directory for the model -RUN mkdir -p /app/models +# Copy the application code +COPY --chown=user:user . /home/user/app/ # Set an argument for the model path ARG MODEL_PATH ENV MODEL_PATH=${MODEL_PATH} # Set the entry point to run the inference script -ENTRYPOINT ["python3", "src/run_inference.py"] - +ENTRYPOINT ["python3", "src/run_inference.py"] \ No newline at end of file