# Use the base image from kojikno/ot-robot-server FROM kojikno/ot-robot-server:v1.2 # Set environment variables for pyenv ENV HOME /root ENV PYENV_ROOT $HOME/.pyenv ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH # Initialize pyenv RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc RUN echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc RUN echo 'eval "$(pyenv init --path)"' >> ~/.bashrc RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc # Set the working directory WORKDIR /root/opentrons # EXPOSE 31950 # Run chat UI # RUN /bin/bash -c "source ~/.bashrc && pyenv install 3.8.5" # RUN /bin/bash -c "source ~/.bashrc && pyenv global 3.8.5" # RUN /bin/bash -c "source ~/.bashrc && pip install gradio" # RUN /bin/bash -c "source ~/.bashrc && python app.py" # Run make command in robot-server directory RUN /bin/bash -c "source ~/.bashrc && make -C robot-server dev" # 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 ["pip" "install", "-r", "requirements"] CMD ["python", "main.py"]