Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -8
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Use
|
| 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
|
| 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
|
| 44 |
RUN pip3 install -r requirements.txt && \
|
| 45 |
-
pip3 install logback==0.2.1 #
|
| 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 |
-
#
|
| 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 |
|