File size: 1,174 Bytes
d4d41c8
cf13325
d4d41c8
 
cf13325
bf0d42a
 
 
d4d41c8
bf0d42a
d4d41c8
cf13325
d4d41c8
 
e13c2b7
d4d41c8
 
cf13325
d4d41c8
 
cf13325
d4d41c8
 
 
 
 
cf13325
d4d41c8
bf0d42a
 
0c01de4
bf0d42a
 
69fe7bd
 
1fdc52f
5e42df4
a26575a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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'"]