mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-07 19:18:34 +03:00
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
|
|
volumes:
|
|
crawls:
|
|
|
|
name: "auto-archiver-api"
|
|
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: web.Dockerfile
|
|
restart: always
|
|
env_file: .env.prod
|
|
environment:
|
|
ENVIRONMENT_FILE: .env.prod
|
|
REDIS_HOSTNAME: redis
|
|
ports:
|
|
- "127.0.0.1:8004:8000"
|
|
command: uvicorn app.web:app --factory --host 0.0.0.0
|
|
volumes:
|
|
- ./logs:/aa-api/logs
|
|
- ./database:/aa-api/database
|
|
depends_on:
|
|
- redis
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: worker.Dockerfile
|
|
restart: always
|
|
env_file: .env.prod
|
|
command: celery --app=app.worker.main.celery worker --loglevel=warning --logfile=/aa-api/logs/celery.log
|
|
volumes:
|
|
- ./logs:/aa-api/logs
|
|
- ./database:/aa-api/database
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- crawls:/crawls # BROWSERTRIX_HOME_HOST:BROWSERTRIX_HOME_CONTAINER, do not change /crawls
|
|
environment:
|
|
REDIS_HOSTNAME: redis
|
|
ENVIRONMENT_FILE: .env.prod
|
|
WACZ_ENABLE_DOCKER: 1 # Enable calling docker from this container
|
|
BROWSERTRIX_HOME_HOST: auto-archiver-api_crawls
|
|
BROWSERTRIX_HOME_CONTAINER: /crawls
|
|
depends_on:
|
|
- web
|
|
- redis
|
|
healthcheck:
|
|
test: ["CMD", "pipenv", "run", "celery", "-A", "worker.main.celery", "status"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
redis:
|
|
image: redis:6-alpine
|
|
restart: always
|
|
env_file: .env.prod
|
|
command: redis-server /conf/redis.conf --requirepass ${REDIS_PASSWORD}
|
|
volumes:
|
|
- ./redis/data:/data
|
|
- ./redis/config:/conf
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3 |