Files
auto-archiver-api/docker-compose.yml

68 lines
1.9 KiB
YAML

volumes:
crawls:
name: "auto-archiver-api"
services:
web:
build:
context: .
dockerfile: worker.Dockerfile
restart: always
env_file: .env.prod
environment:
CELERY_BROKER_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
ports:
- "127.0.0.1:8004:8000"
#TODO: should prod have the --reload flag?
command: uvicorn app.web:app --factory --host 0.0.0.0
volumes:
# - ./app:/app
- ./app/logs:/aa-api/app/logs
- ./app/database:/aa-api/app/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=info --logfile=/aa-api/app/logs/celery.log
volumes:
- ./app/logs:/aa-api/app/logs
- ./app/database:/aa-api/app/database
- /var/run/docker.sock:/var/run/docker.sock
- crawls:/crawls # BROWSERTRIX_HOME_HOST:BROWSERTRIX_HOME_CONTAINER, do not change /crawls
environment:
CELERY_BROKER_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
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
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