|
|
|
|
|
FROM python:3.10 |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
|
|
RUN git clone https://github.com/NeotomaDB/MetaExtractor.git |
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN sed -i "s|port=8050|port=7860 |g" ./MetaExtractor/src/data_review_tool/app.py \ |
|
&& sed -i "s|logger.addHandler(get_file_handler())|#logger.addHandler(get_file_handler())|g" ./MetaExtractor/src/logs.py \ |
|
&& sed -i 's|/entity_extraction|./entity_extraction|g' ./MetaExtractor/src/data_review_tool/app.py \ |
|
&& sed -i 's|/entity_extraction|./entity_extraction|g' ./MetaExtractor/src/data_review_tool/pages/home.py \ |
|
&& sed -i 's|/MetaExtractor|.|g' ./MetaExtractor/src/data_review_tool/pages/home.py \ |
|
&& sed -i 's|/MetaExtractor|.|g' ./MetaExtractor/src/data_review_tool/pages/article_review.py \ |
|
&& sed -i 's|/entity_extraction|/home/user/app/MetaExtractor/entity_extraction|g' ./MetaExtractor/src/data_review_tool/pages/article_review.py \ |
|
&& sed -i "s|/MetaExtractor/inputs/|./inputs/|g" ./MetaExtractor/src/data_review_tool/app.py \ |
|
&& sed -i 's|debug=True|debug=False|g' ./MetaExtractor/src/data_review_tool/app.py |
|
|
|
|
|
|
|
|
|
COPY ./requirements.txt ./requirements.txt |
|
RUN pip install -r requirements.txt |
|
|
|
WORKDIR MetaExtractor/ |
|
|
|
ENV LOG_LEVEL=DEBUG |
|
|
|
EXPOSE 7860 |
|
|
|
RUN pip install pyarrow |
|
|
|
RUN mkdir -p ./inputs |
|
|
|
|
|
ENV ARTICLE_RELEVANCE_BATCH=article-relevance-output.parquet |
|
ENV ENTITY_EXTRACTION_BATCH=entity-extraction-output.zip |
|
|
|
|
|
RUN cp ./data/data-review-tool/article-relevance-output.parquet ./inputs \ |
|
&& cp ./data/data-review-tool/entity-extraction-output.zip ./inputs |
|
|
|
|
|
RUN chown -R root:user ../MetaExtractor/ \ |
|
&& chmod -R 775 ../MetaExtractor/ |
|
|
|
|
|
USER user |
|
|
|
ENTRYPOINT python src/data_review_tool/app.py |