Spaces:
Sleeping
Sleeping
File size: 1,162 Bytes
d47a112 e92fdb2 d47a112 e92fdb2 d47a112 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
# Install Python
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum install -y python39 python39-pip wget
# Copy setup files
COPY ./requirements.txt requirements.txt
COPY ./start.sh start.sh
RUN chown elasticsearch:elasticsearch requirements.txt
RUN chown elasticsearch:elasticsearch start.sh
# Change the user to the default user for the elasticsearch image
USER elasticsearch
# API KEY and password
RUN --mount=type=secret,id=API_KEY,mode=0444,required=false
ARG API_KEY=$(cat /run/secrets/API_KEY)
RUN --mount=type=secret,id=PASSWORD,mode=0444,required=false
ARG PASSWORD=$(cat /run/secrets/PASSWORD)
# Install Python deps
RUN pip3 install -U -r requirements.txt
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
# Make scripts executable
RUN chmod +x wait-for-it.sh
RUN chmod +x start.sh
# Expose the application's port
EXPOSE 6900
# Set the command to run the shell script
CMD ["./start.sh"] |