version: '3' services: bookwyrm-db: container_name: bookwyrm-db image: postgres env_file: bookwyrm/env volumes: - ./data/bookwyrm/pgdata:/var/lib/postgresql/data bookwyrm-redis_activity: container_name: bookwyrm-redis_activity image: redis env_file: bookwyrm/env command: redis-server --requirepass redispassword123 --appendonly yes volumes: - ./bookwyrm/redis.conf:/etc/redis/redis.conf:ro - ./data/bookwyrm/redis_activity_data:/data restart: on-failure bookwyrm-redis_broker: container_name: bookwyrm-redis_broker image: redis command: redis-server --requirepass redispassword123 --appendonly yes env_file: bookwyrm/env volumes: - ./bookwyrm/redis.conf:/etc/redis/redis.conf:ro - ./data/bookwyrm/redis_broker_data:/data restart: on-failure bookwyrm-web: container_name: bookwyrm-web image: osresearch/bookwyrm:oidc command: python manage.py runserver 0.0.0.0:8000 env_file: bookwyrm/env volumes: - ./data/bookwyrm/static_volume:/app/static - ./data/bookwyrm/media_volume:/app/images environment: - DB_INIT=True - DOMAIN=${BOOKWYRM_HOSTNAME}.${DOMAIN_NAME} - EMAIL=books@${DOMAIN_NAME} - EMAIL_HOST=${SMTP_SERVER} - EMAIL_PORT=${SMTP_PORT} - EMAIL_HOST_USER=${SMTP_USER} - EMAIL_HOST_PASSWORD=${SMTP_PASSWORD} - EMAIL_USE_TLS=true - EMAIL_USE_SSL=false - EMAIL_SENDER_NAME=books - EMAIL_SENDER_DOMAIN=${DOMAIN_NAME} - OIDC_ENABLED=true - OIDC_CLIENT_ID=bookwyrm - OIDC_CLIENT_SECRET=${BOOKWYRM_CLIENT_SECRET} - OIDC_OP_BASE_URL=${KEYCLOAK_BASE_URL} depends_on: - bookwyrm-db - bookwyrm-celery_worker - bookwyrm-redis_activity bookwyrm-celery_worker: container_name: bookwyrm-worker image: osresearch/bookwyrm:oidc command: celery -A celerywyrm worker -l info -Q high_priority,medium_priority,low_priority env_file: bookwyrm/env volumes: - ./data/bookwyrm/static_volume:/app/static - ./data/bookwyrm/media_volume:/app/images environment: - DOMAIN=${BOOKWYRM_HOSTNAME}.${DOMAIN_NAME} - EMAIL=books@${DOMAIN_NAME} - EMAIL_HOST=${SMTP_SERVER} - EMAIL_PORT=${SMTP_PORT} - EMAIL_HOST_USER=${SMTP_USER} - EMAIL_HOST_PASSWORD=${SMTP_PASSWORD} - EMAIL_USE_TLS=true - EMAIL_USE_SSL=false - EMAIL_SENDER_NAME=books - EMAIL_SENDER_DOMAIN=${DOMAIN_NAME} depends_on: - bookwyrm-db - bookwyrm-redis_broker restart: on-failure bookwyrm-celery_beat: container_name: bookwyrm-beat image: osresearch/bookwyrm:oidc command: celery -A celerywyrm beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler env_file: bookwyrm/env volumes: - ./data/bookwyrm/static_volume:/app/static - ./data/bookwyrm/media_volume:/app/images environment: - DOMAIN=${BOOKWYRM_HOSTNAME}.${DOMAIN_NAME} - EMAIL=books@${DOMAIN_NAME} - EMAIL_HOST=${SMTP_SERVER} - EMAIL_PORT=${SMTP_PORT} - EMAIL_HOST_USER=${SMTP_USER} - EMAIL_HOST_PASSWORD=${SMTP_PASSWORD} - EMAIL_USE_TLS=true - EMAIL_USE_SSL=false - EMAIL_SENDER_NAME=books - EMAIL_SENDER_DOMAIN=${DOMAIN_NAME} depends_on: - bookwyrm-celery_worker restart: on-failure bookwyrm-flower: container_name: bookwyrm-flower image: osresearch/bookwyrm:oidc command: celery -A celerywyrm flower --basic_auth=admin:${BOOKWYRM_ADMIN_PASSWORD} env_file: bookwyrm/env # ports: # - ${FLOWER_PORT}:${FLOWER_PORT} volumes: - ./data/bookwyrm/static_volume:/app/static - ./data/bookwyrm/media_volume:/app/images environment: - DOMAIN=${BOOKWYRM_HOSTNAME}.${DOMAIN_NAME} - EMAIL=books@${DOMAIN_NAME} - EMAIL_HOST=${SMTP_SERVER} - EMAIL_PORT=${SMTP_PORT} - EMAIL_HOST_USER=${SMTP_USER} - EMAIL_HOST_PASSWORD=${SMTP_PASSWORD} - EMAIL_USE_TLS=true - EMAIL_USE_SSL=false - EMAIL_SENDER_NAME=books - EMAIL_SENDER_DOMAIN=${DOMAIN_NAME} depends_on: - bookwyrm-db - bookwyrm-redis_broker restart: on-failure nginx: volumes: - ./bookwyrm/nginx.conf:/etc/nginx/templates/bookwyrm.conf.template:ro - ./data/bookwyrm/static_volume:/bookwyrm/app/static:ro - ./data/bookwyrm/media_volume:/bookwyrm/app/images:ro # add the subdomain client secrets to the keycloak-setup volume keycloak: volumes: - ./bookwyrm/keycloak.sh:/keycloak-setup/bookwyrm.sh:ro