rhoitjadhav's picture
update dockerfile
142dd1a
raw
history blame
1.49 kB
FROM python:3.9-slim
# Exposing ports
EXPOSE 6900
# Environment variables
ENV ARGILLA_LOCAL_AUTH_USERS_DB_FILE=/packages/users.yml
ENV UVICORN_PORT=6900
# Copying argilla distribution files
COPY *.whl /packages/
# Copy users db file along with execution script
COPY start.sh /
COPY load_data.py /
COPY users.yml /packages/
# Install packages
RUN apt update
RUN apt -y install python3.9-dev gcc gnupg apache2-utils systemctl curl sudo vim
# Create new user for starting elasticsearch
RUN useradd -ms /bin/bash user -p "$(openssl passwd -1 ubuntu)"
RUN echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Install argilla
RUN chmod +x /start.sh \
&& for wheel in /packages/*.whl; do pip3 install "$wheel"[server]; done
# Install Elasticsearch
RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
RUN echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-8.x.list
RUN apt update
RUN apt -y install elasticsearch=8.5.3
# Disable security in elasticsearch configuration
RUN sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
RUN sudo sed -i "s/cluster.initial_master_nodes/#cluster.initial_master_nodes/g" /etc/elasticsearch/elasticsearch.yml
RUN sudo sed -i '$ a\cluster.routing.allocation.disk.threshold_enabled: false' /etc/elasticsearch/elasticsearch.yml
# Executing argilla along with elasticsearch
CMD /bin/bash /start.sh