name: mastodon services: web: image: lscr.io/linuxserver/mastodon:latest container_name: mastodon-web restart: always pull_policy: always environment: - TZ=America/New_York - WEB_DOMAIN=${BASE_HOST_NAME} - LOCAL_DOMAIN=${BASE_HOST_NAME} - OTP_SECRET=${OTP_SECRET:-Kw6QTR4wuyqyJ7dUyg81N7s8EvksmDlu} - SECRET_KEY_BASE=${SECRET_KEY_BASE:-EKUaB9LeLn433co2fVSF5pQj4nWDKIWm} - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=${ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY:-OJTGYuCw5t1BEIqpAtrnK9HTUQ9jZ1QV} - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=${ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT:-bhBhkXghpAEDioU6kefAT1zG4yy6Rwyp} - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=${ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY:-X1nyDm6OkDJlwu6TzQ5e137G5oiQXDqc} - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY:-GoV9Q8Uye3f_zJS36CoiJE1DQp4yPRN0MfIkWO5Zxrk=} - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY:-BBEyKQxFj_haRQsH4eD_4XjvxuU3yjIIRQXysowVNdP22AVnGoP2gZ6KJJmksa80cQ1HhvzwtVx76ghG1yBolB8=} - AWS_ACCESS_KEY_ID= - AWS_SECRET_ACCESS_KEY= - DB_POOL=5 - NO_CHOWN=false - SMTP_SERVER=${EMAIL_SERVER_HOST:-172.17.0.1} - SMTP_PORT=${EMAIL_SERVER_PORT:-25} - SMTP_FROM_ADDRESS=no-reply@${BASE_HOST_NAME} - SMTP_LOGIN=${EMAIL_SERVER_LOGIN_NAME:-} - SMTP_PASSWORD=${EMAIL_SERVER_LOGIN_PASS:-} - S3_ENABLED=false - S3_BUCKET= - S3_ALIAS_HOST= - REDIS_HOST=mastodon-redis - REDIS_PORT=6379 - DB_HOST=mastodon-postgres - DB_USER=mastodon - DB_NAME=mastodon - DB_PASS=mastodon - DB_PORT=5432 - ES_ENABLED=false - ES_HOST=mastodon-elastic - ES_PORT=9200 - ES_USER=elastic - ES_PASS=elastic - SIDEKIQ_ONLY=false - SIDEKIQ_QUEUE= - SIDEKIQ_DEFAULT=false - SIDEKIQ_THREADS=5 volumes: - /var/lib/srv/${USER}/docker/linuxserver/mastodon/latest/rootfs/config/mastodon:/config ports: - '172.17.0.1:59038:80' - '172.17.0.1:59039:443' networks: - mastodon streaming: image: ghcr.io/mastodon/mastodon-streaming:latest container_name: mastodon-streaming restart: always pull_policy: always command: node ./streaming/index.js environment: - REDIS_HOST=mastodon-redis - REDIS_PORT=6379 - DB_HOST=mastodon-postgres - DB_USER=mastodon - DB_NAME=mastodon - DB_PASS=mastodon - DB_PORT=5432 - ES_ENABLED=false - ES_HOST=mastodon-elastic - ES_PORT=9200 - ES_USER=elastic - ES_PASS=elastic expose: - 4000 depends_on: - web - postgres - redis healthcheck: test: [ 'CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1", ] networks: - mastodon postgres: image: postgres:14-alpine container_name: mastodon-postgres restart: always pull_policy: always shm_size: 256mb volumes: - /var/lib/srv/${USER}/docker/linuxserver/mastodon/latest/rootfs/data/db/postgres:/var/lib/postgresql/data environment: - 'POSTGRES_USER=mastodon' - 'POSTGRES_PASSWORD=mastodon' - 'POSTGRES_HOST_AUTH_METHOD=trust' networks: - mastodon healthcheck: test: ['CMD', 'pg_isready', '-U', 'mastodon'] redis: image: redis:7-alpine restart: always pull_policy: always container_name: mastodon-redis volumes: - /var/lib/srv/${USER}/docker/linuxserver/mastodon/latest/rootfs/data/db/redis:/data healthcheck: test: ['CMD', 'redis-cli', 'ping'] networks: - mastodon networks: mastodon: name: mastodon external: false