# Base image | |
FROM docker.elastic.co/elasticsearch/elasticsearch:8.6.2 | |
# Change owner and permissions of /etc/apt | |
RUN chown root:root /etc/apt && chmod 644 /etc/apt/sources.list | |
# Install Python and dependencies | |
RUN apt-get update && apt-get install -y python3 python3-pip | |
WORKDIR /code | |
COPY ./requirements.txt /code/requirements.txt | |
RUN pip3 install -r requirements.txt | |
COPY . . | |
# Copy configuration files | |
COPY elasticsearch.yml /usr/share/elasticsearch/config/ | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] && /usr/local/bin/docker-entrypoint.sh elasticsearch |