ginnigarg commited on
Commit
b92c928
·
verified ·
1 Parent(s): 743d582

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -6
Dockerfile CHANGED
@@ -1,24 +1,39 @@
1
  FROM python:3.9-slim
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
- curl \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  # Install Python dependencies
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
 
 
 
 
 
 
 
 
 
12
  # Copy application code
13
  COPY . .
14
 
15
- # Expose ports (Gradio + Argilla)
16
  EXPOSE 7860
17
  EXPOSE 6900
 
18
 
19
- # Health check
20
  HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \
21
  CMD curl -f http://localhost:6900/api/docs || exit 1
22
 
23
- # Run startup script
24
- CMD ["python", "app.py"]
 
 
 
 
 
1
  FROM python:3.9-slim
2
 
3
+ # Install system dependencies + Java for Elasticsearch
4
  RUN apt-get update && apt-get install -y \
5
+ curl openjdk-11-jdk wget gnupg unzip \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  # Install Python dependencies
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Install Elasticsearch
13
+ ENV ES_VERSION=7.17.23
14
+ RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz && \
15
+ tar -xzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz && \
16
+ mv elasticsearch-${ES_VERSION} /usr/share/elasticsearch && \
17
+ rm elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
18
+
19
+ ENV PATH="/usr/share/elasticsearch/bin:${PATH}"
20
+ ENV ES_HOME=/usr/share/elasticsearch
21
+
22
  # Copy application code
23
  COPY . .
24
 
25
+ # Expose ports (Gradio + Argilla + Elasticsearch)
26
  EXPOSE 7860
27
  EXPOSE 6900
28
+ EXPOSE 9200
29
 
30
+ # Health check (check Argilla, not ES directly)
31
  HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \
32
  CMD curl -f http://localhost:6900/api/docs || exit 1
33
 
34
+ # Start both Elasticsearch and your app
35
+ CMD ["/bin/bash", "-c", "\
36
+ elasticsearch -d -Ediscovery.type=single-node && \
37
+ sleep 15 && \
38
+ python app.py \
39
+ "]