|
|
|
FROM python:3.9 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
RUN pip3 install -r requirements.txt |
|
|
|
|
|
RUN apt-get update && apt-get install -y wget && \ |
|
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.6.2-linux-x86_64.tar.gz && \ |
|
tar -xzf elasticsearch-8.6.2-linux-x86_64.tar.gz && \ |
|
rm elasticsearch-8.6.2-linux-x86_64.tar.gz && \ |
|
mv elasticsearch-8.6.2 /usr/share/elasticsearch && \ |
|
chown -R 1000:1000 /usr/share/elasticsearch && \ |
|
chmod -R 777 /usr/share/elasticsearch |
|
|
|
|
|
RUN echo "network.host: localhost" >> /usr/share/elasticsearch/config/elasticsearch.yml && \ |
|
echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml |
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
CMD ["/bin/bash", "-c", "/usr/share/elasticsearch/bin/elasticsearch && python3 crawl_index.py && uvicorn app:app --host 0.0.0.0 --port 7860"] |
|
|