FROM python:3.10.12-slim as release ARG USER=nroot ARG UID=1000 ARG GID=100 # Install patches RUN apt-get update && apt-get upgrade -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists # Install python packages COPY ../requirements/predictions/predictions.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Create and configure non-root user RUN useradd \ --create-home \ --uid ${UID} \ --gid ${GID} \ --shell /bin/bash \ ${USER} # Copy the project code to user home directory COPY --chown=${UID}:${GID} ./core /home/simulation_system/core COPY --chown=${UID}:${GID} ./MLModel /home/simulation_system/MLModel COPY --chown=${UID}:${GID} ./predictions.py /home/simulation_system/predictions.py # FOR TESTING # COPY --chown=${UID}:${GID} ./model_build_data /home/simulation_system/model_build_data # Switch user USER ${USER} WORKDIR /home/simulation_system # Run the python command CMD ["python3", "predictions.py", "--data-path", "./model_build_data/change_data/rdsap_full/test_data.parquet"]