rhoitjadhav commited on
Commit
d4d41c8
1 Parent(s): cf13325

update dockerfile and users.yml

Browse files
Files changed (3) hide show
  1. Dockerfile +23 -30
  2. start.sh +0 -16
  3. users.yml +9 -0
Dockerfile CHANGED
@@ -1,38 +1,31 @@
1
- FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
2
 
3
- # Install Python
4
- RUN cd /etc/yum.repos.d/
5
- RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
6
- RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
7
- RUN yum install -y python39 python39-pip wget
8
-
9
- # Copy setup files
10
- COPY ./requirements.txt requirements.txt
11
- COPY ./start.sh start.sh
12
- RUN chown elasticsearch:elasticsearch requirements.txt
13
- RUN chown elasticsearch:elasticsearch start.sh
14
-
15
- # Change the user to the default user for the elasticsearch image
16
- USER elasticsearch
17
 
18
- # API KEY and password
19
- RUN --mount=type=secret,id=API_KEY,mode=0444,required=false
20
- ARG API_KEY=$(cat /run/secrets/API_KEY)
21
 
22
- RUN --mount=type=secret,id=PASSWORD,mode=0444,required=false
23
- ARG PASSWORD=$(cat /run/secrets/PASSWORD)
 
 
 
24
 
25
- # Install Python deps
26
- RUN pip3 install -U -r requirements.txt
27
 
28
- RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
 
 
 
 
29
 
30
- # Make scripts executable
31
- RUN chmod +x wait-for-it.sh
32
- RUN chmod +x start.sh
 
33
 
34
- # Expose the application's port
35
- EXPOSE 6900
36
 
37
- # Set the command to run the shell script
38
- CMD ["./start.sh"]
 
1
+ FROM ubuntu:20.04
2
 
3
+ # Exposing ports
4
+ EXPOSE 6900
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ # Environment variables
7
+ ENV USERS_DB=/users.yml
8
+ ENV UVICORN_PORT=6900
9
 
10
+ # Install Python
11
+ RUN apt update
12
+ RUN apt -y install curl python3.9 python3.9-dev python3.9-distutils gcc gnupg
13
+ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
14
+ RUN python3.9 get-pip.py
15
 
16
+ # Install argilla
17
+ RUN pip install argilla[server]
18
 
19
+ # Install Elasticsearch
20
+ RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
21
+ RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
22
+ RUN apt update
23
+ RUN apt -y install elasticsearch
24
 
25
+ # Copy users db file along with execution script
26
+ COPY users.yml /
27
+ COPY start.sh /
28
+ RUN chmod +x /start.sh
29
 
30
+ CMD /bin/bash /start.sh
 
31
 
 
 
start.sh DELETED
@@ -1,16 +0,0 @@
1
-
2
- ES_JAVA_OPTS=-'Xms512m -Xmx512m' elasticsearch -E node.name=elasticsearch -E cluster.name=es-local -E discovery.type=single-node -E cluster.routing.allocation.disk.threshold_enabled=false &
3
- ./wait-for-it.sh -t 30 localhost:9200
4
- if [ -z "$API_KEY" ] && [ -z "$PASSWORD" ]; then
5
- python3 -m argilla
6
- elif [ -z "$API_KEY" ] && [ -n "$PASSWORD" ]; then
7
- export ARGILLA_LOCAL_AUTH_DEFAULT_PASSWORD=$PASSWORD
8
- python3 -m argilla
9
- elif [ -n "$API_KEY" ] && [ -z "$PASSWORD" ]; then
10
- export ARGILLA_LOCAL_AUTH_DEFAULT_APIKEY=$API_KEY
11
- python3 -m argilla
12
- else
13
- export ARGILLA_LOCAL_AUTH_DEFAULT_APIKEY=$API_KEY
14
- export ARGILLA_LOCAL_AUTH_DEFAULT_PASSWORD=$PASSWORD
15
- python3 -m argilla
16
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
users.yml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ - username: argilla
2
+ hashed_password: $2b$12$vyJHxSgZ1MDeXvqOEVln.OjWiSY9x/wiAx8j9nP2VH0m9cOoyUq.a
3
+ api_key: "argilla.apikey"
4
+ workspaces: ["huggingface"]
5
+ - username: admin
6
+ hashed_password: $2b$12$vyJHxSgZ1MDeXvqOEVln.OjWiSY9x/wiAx8j9nP2VH0m9cOoyUq.a
7
+ api_key: "admin.apikey"
8
+ workspaces: []
9
+