baderanas commited on
Commit
297954e
·
verified ·
1 Parent(s): 3895f78

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use a lighter base image with Java 17 (required by Elasticsearch 8.8.0)
2
  FROM openjdk:17-jdk-slim
3
 
4
  # Install dependencies
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
9
  wget \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Install Elasticsearch
13
  ENV ES_VERSION=8.8.0
14
  RUN curl -O 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 && \
@@ -21,13 +21,11 @@ RUN echo "discovery.type: single-node\n\
21
  xpack.security.enabled: false\n\
22
  network.host: 0.0.0.0" > /usr/share/elasticsearch/config/elasticsearch.yml
23
 
24
- # Create dedicated user and directories
25
  RUN useradd -m -u 1000 appuser && \
26
  mkdir -p /app && \
27
  chown -R appuser:appuser /app /usr/share/elasticsearch
28
 
29
- RUN echo '#!/bin/bash
30
-
31
  # Set working directory
32
  WORKDIR /app
33
 
@@ -40,9 +38,9 @@ COPY --chown=appuser:appuser elastic ./elastic
40
  COPY --chown=appuser:appuser file_processing.py ./
41
  COPY --chown=appuser:appuser ingestion.py ./
42
 
43
- # Install Python dependencies with logging fix
44
  RUN pip3 install -r requirements.txt && \
45
- pip3 install logback==0.2.1 # Fixes SLF4J warnings
46
 
47
  # Configure environment variables
48
  ENV ES_JAVA_OPTS="-Xms1g -Xmx1g" \
@@ -58,7 +56,7 @@ EXPOSE 9200 7860
58
  # Switch to non-root user
59
  USER appuser
60
 
61
- # Improved startup script
62
  COPY --chown=appuser:appuser start.sh /app/start.sh
63
  RUN chmod +x /app/start.sh
64
 
 
1
+ # Use correct Java 17 base image
2
  FROM openjdk:17-jdk-slim
3
 
4
  # Install dependencies
 
9
  wget \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Install Elasticsearch 8.8.0
13
  ENV ES_VERSION=8.8.0
14
  RUN curl -O 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 && \
 
21
  xpack.security.enabled: false\n\
22
  network.host: 0.0.0.0" > /usr/share/elasticsearch/config/elasticsearch.yml
23
 
24
+ # Create user and directories
25
  RUN useradd -m -u 1000 appuser && \
26
  mkdir -p /app && \
27
  chown -R appuser:appuser /app /usr/share/elasticsearch
28
 
 
 
29
  # Set working directory
30
  WORKDIR /app
31
 
 
38
  COPY --chown=appuser:appuser file_processing.py ./
39
  COPY --chown=appuser:appuser ingestion.py ./
40
 
41
+ # Install Python dependencies
42
  RUN pip3 install -r requirements.txt && \
43
+ pip3 install logback==0.2.1 # For SLF4J compatibility
44
 
45
  # Configure environment variables
46
  ENV ES_JAVA_OPTS="-Xms1g -Xmx1g" \
 
56
  # Switch to non-root user
57
  USER appuser
58
 
59
+ # Create proper startup script
60
  COPY --chown=appuser:appuser start.sh /app/start.sh
61
  RUN chmod +x /app/start.sh
62