Spaces:
Runtime error
Runtime error
dvsrepo
commited on
Commit
•
d47a112
1
Parent(s):
86f6385
initial commit
Browse files- .gitignore +1 -0
- Dockerfile +40 -0
- README.md +2 -1
- start.sh +4 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.history
|
Dockerfile
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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=true
|
20 |
+
ARG API_KEY=$(cat /run/secrets/API_KEY)
|
21 |
+
|
22 |
+
RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true
|
23 |
+
ARG PASSWORD=$(cat /run/secrets/PASSWORD)
|
24 |
+
|
25 |
+
RUN echo $PASSWORD
|
26 |
+
|
27 |
+
# Install Python deps
|
28 |
+
RUN pip3 install -U -r requirements.txt
|
29 |
+
|
30 |
+
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
|
31 |
+
|
32 |
+
# Make scripts executable
|
33 |
+
RUN chmod +x wait-for-it.sh
|
34 |
+
RUN chmod +x start.sh
|
35 |
+
|
36 |
+
# Expose the application's port
|
37 |
+
EXPOSE 6900
|
38 |
+
|
39 |
+
# Set the command to run the shell script
|
40 |
+
CMD ["./start.sh"]
|
README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
---
|
2 |
-
title: Template Space Docker
|
3 |
emoji: 📊
|
4 |
colorFrom: gray
|
5 |
colorTo: yellow
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
|
10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: Template Argilla Space Docker
|
3 |
emoji: 📊
|
4 |
colorFrom: gray
|
5 |
colorTo: yellow
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
+
app_port: 6900
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
start.sh
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
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 |
+
python3 -m argilla
|