Update Dockerfile for poetry.

Note: Review security with curl installation. Currently locked to known version, but additional checks could be added.
pull/164/head
erinhmclark 2024-12-31 14:10:52 +00:00
rodzic 5490947657
commit 660ee82c67
1 zmienionych plików z 17 dodań i 15 usunięć

Wyświetl plik

@ -1,11 +1,13 @@
FROM webrecorder/browsertrix-crawler:1.0.4 FROM webrecorder/browsertrix-crawler:1.0.4
ENV RUNNING_IN_DOCKER=1 ENV RUNNING_IN_DOCKER=1
ENV PATH="/root/.local/bin:$PATH"
WORKDIR /app WORKDIR /app
RUN pip install --upgrade pip && \ RUN pip install --upgrade pip && \
pip install pipenv && \ curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3 && \
poetry --version && \
add-apt-repository ppa:mozillateam/ppa && \ add-apt-repository ppa:mozillateam/ppa && \
apt-get update && \ apt-get update && \
apt-get install -y gcc ffmpeg fonts-noto exiftool && \ apt-get install -y gcc ffmpeg fonts-noto exiftool && \
@ -16,15 +18,15 @@ RUN pip install --upgrade pip && \
chmod +x /usr/local/bin/geckodriver && \ chmod +x /usr/local/bin/geckodriver && \
rm geckodriver-v* rm geckodriver-v*
COPY pyproject.toml poetry.lock ./
COPY Pipfile* ./ # Verify Poetry installation and install dependencies
# install from pipenv, with browsertrix-only requirements RUN poetry install --no-root
RUN pipenv install
# doing this at the end helps during development, builds are quick # doing this at the end helps during development, builds are quick
COPY ./src/ . COPY ./src/ .
ENTRYPOINT ["pipenv", "run", "python3", "-m", "auto_archiver"] ENTRYPOINT ["poetry", "run", "python3", "-m", "auto_archiver"]
# should be executed with 2 volumes (3 if local_storage is used) # should be executed with 2 volumes (3 if local_storage is used)
# docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive aa pipenv run python3 -m auto_archiver --config secrets/orchestration.yaml # docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive aa pipenv run python3 -m auto_archiver --config secrets/orchestration.yaml