-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (35 loc) · 1.28 KB
/
Dockerfile
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
39
40
41
42
43
44
45
FROM python:3.10.11
# Update and install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y chromium chromium-driver xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/chromedriver /usr/local/bin/chromedriver
RUN pip3.10 install --no-cache-dir \
'git+https://github.com/loewa86/exorde_data.git' \
'git+https://github.com/loewa86/exorde-client.git'\
selenium==4.2.0 \
wtpsplit==1.2.3 \
&& pip3.10 install --no-cache-dir --upgrade 'git+https://github.com/JustAnotherArchivist/snscrape.git'
# set display port to avoid crash
ENV DISPLAY=:99
## INSTALL ALL MODELS
COPY exorde/pre_install.py /exorde/exorde_install_models.py
WORKDIR /exorde
RUN python3.10 exorde_install_models.py \
&& rm -rf /root/.cache/* \
&& rm -rf /root/.local/cache/*
RUN python3.10 -m spacy download en_core_web_trf \
&& rm -rf /root/.cache/*
## INSTALL THE APP
COPY data /exorde
## Set the release version
ARG RELEASE_VERSION
RUN echo ${RELEASE_VERSION} > .release
## ENTRY POINT IS MAIN.PY
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
COPY keep_alive.sh /exorde/keep_alive.sh
RUN chmod +x /exorde/keep_alive.sh
RUN sed -i 's/\r$//' keep_alive.sh
ENTRYPOINT ["/bin/bash","/exorde/keep_alive.sh"]