# 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 RUN apt-get install libudev-dev # Set the working directory WORKDIR /root/opentrons # EXPOSE 31950 RUN ls # 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" # RUN /bin/bash -c "source ~/.bashrc && make robot-server setup" # Install yarn # RUN /bin/bash -c "source ~/.bashrc && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn" # ENV NODE_VERSION 16.18.0 # # Install nvm with node and npm # RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.38.0/install.sh | bash \ # && . $NVM_DIR/nvm.sh \ # && nvm install $NODE_VERSION \ # && nvm alias default $NODE_VERSION \ # && nvm use default # Set up PATH so that Node.js and npm can be found # ENV PATH $NVM_DIR/versions/node/v16.18.0/bin:$PATH # Install systemd RUN apt-get update && apt-get install -y libsystemd-dev # Run make command in robot-server directory RUN /bin/bash -c "source ~/.bashrc && make -C robot-server setup" # 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"] USER root RUN pip install -r requirements.txt #USER user COPY --chown=root . $HOME/app # CMD ["python", "main.py"] COPY entrypoint.sh /entrypoint.sh RUN chmod +x entrypoint.sh WORKDIR /root/opentrons # ENTRYPOINT ["#!/bin/bash", "-c", "entrypoint.sh"] ENTRYPOINT ["source", "entrypoint.sh"]