From 8e4801f3d3a6b43b7bc9dcd505fbd735e9da40b2 Mon Sep 17 00:00:00 2001 From: Lilia Kai Date: Tue, 12 Sep 2023 16:03:11 +0200 Subject: [PATCH] Run browsertrix in docker on the host Install docker in the container Add a named volume called `browsertrix` Mount the named volume in the worker at /crawls Expose the host docker socket Override the environment variable from auto-archiver's Dockerfile so that it will call docker. This will require setting new configs in orchestration.yaml: wacz_archiver_enricher: browsertrix_home: auto-archiver-api_browsertrix wacz_collections: /crawls --- docker-compose.yml | 8 ++++++++ src/Dockerfile | 2 ++ 2 files changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index fa99160..43892a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,8 @@ version: '3.8' +volumes: + browsertrix: + services: web: @@ -23,10 +26,15 @@ services: command: celery worker --app=worker.celery --loglevel=info --logfile=logs/celery.log volumes: - ./src:/app + - /var/run/docker.sock:/var/run/docker.sock + - browsertrix:/crawls + env_file: src/.env environment: - CELERY_BROKER_URL=redis://:${REDIS_PASSWORD}@redis:6379/0 - CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:6379/0 + - RUNNING_IN_DOCKER= # Override env from auto-archiver Dockerfile + depends_on: - web - redis diff --git a/src/Dockerfile b/src/Dockerfile index 7e01b7e..bd44d70 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -4,6 +4,8 @@ FROM bellingcat/auto-archiver # set work directory WORKDIR /app +RUN curl -fsSL https://get.docker.com -o get-docker.sh && \ + sh get-docker.sh # set environment variables ENV PYTHONUNBUFFERED 1 ENV PYTHONDONTWRITEBYTECODE 1