rhoitjadhav commited on
Commit
fcffc62
1 Parent(s): 147cab5

update dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +9 -2
  2. start.sh +21 -1
Dockerfile CHANGED
@@ -1,6 +1,11 @@
1
  FROM docker.elastic.co/elasticsearch/elasticsearch:8.5.3
2
 
3
  # Environment variable
 
 
 
 
 
4
  ENV UVICORN_PORT=6900
5
  ENV xpack.security.enabled=false
6
  ENV cluster.routing.allocation.disk.threshold_enabled=false
@@ -16,13 +21,15 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
16
  RUN python3.9 get-pip.py
17
  RUN pip3 install datasets
18
 
19
-
20
  COPY start.sh /
21
  RUN chmod +x /start.sh
22
-
23
  COPY *.whl /packages/
24
 
25
  # Install argilla
26
  RUN for wheel in /packages/*.whl; do pip install "$wheel"[server]; done
27
 
 
 
 
 
28
  CMD ["/start.sh"]
 
1
  FROM docker.elastic.co/elasticsearch/elasticsearch:8.5.3
2
 
3
  # Environment variable
4
+ ENV TEAM_PASSWORD=1234
5
+ ENV ARGILLA_PASSWORD=1234
6
+ ENV TEAM_API_KEY=team.apikey
7
+ ENV ARGILLA_API_KEY=argilla.apikey
8
+ ENV LOAD_DATA_ENABLE=true
9
  ENV UVICORN_PORT=6900
10
  ENV xpack.security.enabled=false
11
  ENV cluster.routing.allocation.disk.threshold_enabled=false
 
21
  RUN python3.9 get-pip.py
22
  RUN pip3 install datasets
23
 
 
24
  COPY start.sh /
25
  RUN chmod +x /start.sh
 
26
  COPY *.whl /packages/
27
 
28
  # Install argilla
29
  RUN for wheel in /packages/*.whl; do pip install "$wheel"[server]; done
30
 
31
+ USER elasticsearch
32
+ RUN touch $HOME/users.yml
33
+ RUN chown -R elasticsearch:elasticsearch $HOME/users.yml
34
+
35
  CMD ["/start.sh"]
start.sh CHANGED
@@ -4,10 +4,30 @@ set -e
4
 
5
  # Start Elasticsearch
6
  echo "Starting Elasticsearch"
7
- elasticsearch &
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  echo "Waiting for elasticsearch to start"
10
  sleep 15
11
 
12
  # Start Argilla
 
13
  uvicorn argilla:app --host "0.0.0.0"
 
4
 
5
  # Start Elasticsearch
6
  echo "Starting Elasticsearch"
7
+ elasticsearch 1>/dev/null 2>/dev/null &
8
+ whoami
9
+
10
+ # Create users.yml file
11
+ echo "Creating users schema"
12
+ cat >"$HOME"/users.yml <<EOF
13
+ - username: "team"
14
+ api_key: TEAM_API_KEY
15
+ full_name: Team
16
17
+ hashed_password: TEAM_PASSWORD
18
+ workspaces: []
19
+
20
+ - username: "argilla"
21
+ api_key: ARGILLA_API_KEY
22
+ full_name: Argilla
23
24
+ hashed_password: ARGILLA_PASSWORD
25
+ workspaces: ["team"]
26
+ EOF
27
 
28
  echo "Waiting for elasticsearch to start"
29
  sleep 15
30
 
31
  # Start Argilla
32
+ echo "Starting Argilla"
33
  uvicorn argilla:app --host "0.0.0.0"