FROM ubuntu:20.04 # Exposing ports EXPOSE 6900 # Working Directory WORKDIR /app # Environment variables ENV ARGILLA_LOCAL_AUTH_USERS_DB_FILE=/app/users.yml ENV UVICORN_PORT=6900 # Install Python RUN apt update RUN apt -y install curl python3.9 python3.9-dev python3.9-distutils gcc gnupg apache2-utils sudo openssl RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py RUN python3.9 get-pip.py # Install argilla RUN pip install argilla[server] # Install Elasticsearch RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list RUN apt update RUN apt -y install elasticsearch # Copy users db file along with execution script COPY users.yml /app COPY start.sh /app COPY load_data.py /app RUN chmod +x /app/start.sh RUN useradd -ms /bin/bash user -p "$(openssl passwd -1 ubuntu)" RUN echo 'user ALL=(ALL) ALL' >> /etc/sudoers # Executing argilla along with elasticsearch ENTRYPOINT "/app/start.sh" #CMD ["sudo", "/bin/bash", "-c", "/etc/init.d/elasticsearch start; sleep 15; uvicorn argilla:app --host '0.0.0.0'"]