mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
37 lines
1.1 KiB
Text
37 lines
1.1 KiB
Text
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/training/training.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} ./training.py /home/simulation_system/training.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", "training.py", "--train-filepath", "./model_build_data/change_data/rdsap_full/train_validation_data.parquet", "--test-filepath", "./model_build_data/change_data/rdsap_full/test_data.parquet"]
|