mindchain commited on
Commit
bf2bf65
·
verified ·
1 Parent(s): 8465809

All-in-one: Argilla + Elasticsearch minimal

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -11
Dockerfile CHANGED
@@ -1,23 +1,38 @@
1
- FROM argilla/argilla-server:latest
2
 
3
- # Use HuggingFace Hub as search backend (new feature in Argilla 2.x)
4
- # This avoids needing Elasticsearch
5
- ENV ARGILLA_SEARCH_ENGINE=hub
6
 
7
- # SQLite database
8
- ENV ARGILLA_HOME_PATH=/var/lib/argilla
9
- ENV ARGILLA_DATABASE_URL=sqlite+aiosqlite:////var/lib/argilla/argilla.db
 
 
 
 
 
10
 
11
- # Credentials
 
 
 
 
 
 
12
  ENV USERNAME=argilla
13
  ENV PASSWORD=12345678
14
  ENV API_KEY=argilla.apikey
15
  ENV WORKSPACE=default
16
 
17
- # Create data directory
18
  RUN mkdir -p /var/lib/argilla
19
 
20
  EXPOSE 7860
21
 
22
- # Start with database migration
23
- CMD python -m argilla_server database migrate && python -m argilla_server start --host 0.0.0.0 --port 7860
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
4
 
5
+ # Install Java, Python, curl
6
+ RUN apt-get update && apt-get install -y openjdk-17-jre-headless python3.11 python3-pip curl && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Install Elasticsearch 8 (minimal config)
9
+ RUN curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.11.0-linux-x86_64.tar.gz && tar -xzf elasticsearch-8.11.0-linux-x86_64.tar.gz && rm elasticsearch-8.11.0-linux-x86_64.tar.gz && useradd -m elasticsearch && chown -R elasticsearch:elasticsearch /elasticsearch-8.11.0
10
+
11
+ # Configure ES for minimal memory
12
+ RUN echo "xpack.security.enabled: false" >> /elasticsearch-8.11.0/config/elasticsearch.yml && echo "xpack.security.enrollment.enabled: false" >> /elasticsearch-8.11.0/config/elasticsearch.yml && echo "discovery.type: single-node" >> /elasticsearch-8.11.0/config/elasticsearch.yml && echo "network.host: 127.0.0.1" >> /elasticsearch-8.11.0/config/elasticsearch.yml && echo "-Xms256m" >> /elasticsearch-8.11.0/config/jvm.options && echo "-Xmx256m" >> /elasticsearch-8.11.0/config/jvm.options
13
 
14
+ # Install Argilla
15
+ RUN pip3 install argilla-server
16
+
17
+ # Environment
18
+ ENV ARGILLA_HOME_PATH=/var/lib/argilla
19
+ ENV ARGILLA_DATABASE_URL=sqlite+aiosqlite:////var/lib/argilla/argilla.db
20
+ ENV ARGILLA_ELASTICSEARCH=http://127.0.0.1:9200
21
  ENV USERNAME=argilla
22
  ENV PASSWORD=12345678
23
  ENV API_KEY=argilla.apikey
24
  ENV WORKSPACE=default
25
 
 
26
  RUN mkdir -p /var/lib/argilla
27
 
28
  EXPOSE 7860
29
 
30
+ # Startup script
31
+ RUN echo '#!/bin/bash
32
+ cd /elasticsearch-8.11.0 && su elasticsearch -c "./bin/elasticsearch -d -p /tmp/es.pid"
33
+ sleep 20
34
+ python3 -m argilla_server database migrate
35
+ python3 -m argilla_server start --host 0.0.0.0 --port 7860
36
+ ' > /start.sh && chmod +x /start.sh
37
+
38
+ CMD ["/bin/bash", "/start.sh"]