dockerfile improvements

pull/72/head
msramalho 2022-11-08 13:59:35 +00:00
rodzic 629cd586db
commit 09f47383a3
1 zmienionych plików z 20 dodań i 10 usunięć

Wyświetl plik

@ -1,24 +1,34 @@
# stage 1 - all dependencies
From python:3.10
WORKDIR /app
COPY . .
# TODO: use custom ffmpeg builds instead of apt-get install
RUN pip install --upgrade pip && \
pip install pipenv && \
apt-get update && \
apt-get install -y gcc ffmpeg fonts-noto firefox-esr
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz && \
apt-get install -y gcc ffmpeg fonts-noto firefox-esr && \
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz && \
tar -xvzf geckodriver* -C /usr/local/bin && \
chmod +x /usr/local/bin/geckodriver && \
rm geckodriver-v* && \
pipenv install --python=3.10
rm geckodriver-v*
# install docker for WACZ
RUN curl -fsSL https://get.docker.com | sh
# RUN git clone https://github.com/bellingcat/auto-archiver
# TODO: avoid copying unnecessary files, including .git
# COPY ./src/ .
COPY Pipfile Pipfile.lock ./
RUN pipenv install --python=3.10 --system --deploy
# TODO: to avoid copying pipfile lock it should be on the .dockerignore
ENV IS_DOCKER=1
COPY . .
# CMD ["pipenv", "run", "python", "auto_archive.py"]
ENTRYPOINT ["pipenv", "run", "python", "auto_archive.py"]
ENTRYPOINT ["python", "auto_archive.py"]
# ENTRYPOINT ["docker-entrypoint.sh"]
# should be executed with 2 volumes
# docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/secrets:/app/ aa --help
# docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive aa --help