rhoitjadhav commited on
Commit
8a91b88
·
1 Parent(s): 801778c

update dockerfile

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -0
  2. start.sh +4 -16
  3. users.yaml +13 -0
Dockerfile CHANGED
@@ -13,6 +13,7 @@ COPY *.whl /packages/
13
  # Copy users db file along with execution script
14
  COPY start.sh /
15
  COPY load_data.py /
 
16
 
17
  # Install packages
18
  RUN apt update
 
13
  # Copy users db file along with execution script
14
  COPY start.sh /
15
  COPY load_data.py /
16
+ COPY users.py /packages
17
 
18
  # Install packages
19
  RUN apt update
start.sh CHANGED
@@ -9,22 +9,10 @@ echo "ubuntu" | sudo -S su user
9
  admin_password=$(htpasswd -nbB "" "$ADMIN_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
10
  argilla_password=$(htpasswd -nbB "" "$ARGILLA_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
11
 
12
- # Create users.yml file
13
- sudo cat >/packages/users.yml <<EOF
14
- - username: "admin"
15
- api_key: $ADMIN_API_KEY
16
- full_name: Hugging Face
17
18
- hashed_password: $admin_password
19
- workspaces: []
20
-
21
- - username: "argilla"
22
- api_key: $ARGILLA_API_KEY
23
- full_name: Hugging Face
24
25
- hashed_password: $argilla_password
26
- workspaces: ["admin"]
27
- EOF
28
 
29
  # Disable security in elasticsearch configuration
30
  sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
 
9
  admin_password=$(htpasswd -nbB "" "$ADMIN_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
10
  argilla_password=$(htpasswd -nbB "" "$ARGILLA_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
11
 
12
+ sed -i "s/ADMIN_PASSWORD/$ADMIN_PASSWORD/g" /packages/users.yml
13
+ sed -i "s/ARGILLA_PASSWORD/$ARGILLA_PASSWORD/g" /packages/users.yml
14
+ sed -i "s/ADMIN_API_KEY/$ADMIN_API_KEY/g" /packages/users.yml
15
+ sed -i "s/ARGILLA_API_KEY/$ARGILLA_API_KEY/g" /packages/users.yml
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  # Disable security in elasticsearch configuration
18
  sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
users.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - username: "admin"
2
+ api_key: ADMIN_API_KEY
3
+ full_name: Hugging Face
4
5
+ hashed_password: ADMIN_PASSWORD
6
+ workspaces: [ ]
7
+
8
+ - username: "argilla"
9
+ api_key: ARGILLA_API_KEY
10
+ full_name: Hugging Face
11
12
+ hashed_password: ARGILLA_PASSWORD
13
+ workspaces: [ "admin" ]