Skip to content

Instantly share code, notes, and snippets.

@NoaHimesaka1873
Last active December 6, 2022 01:11
Show Gist options
  • Save NoaHimesaka1873/ea7319e3defecb46f67cb477558922e9 to your computer and use it in GitHub Desktop.
Save NoaHimesaka1873/ea7319e3defecb46f67cb477558922e9 to your computer and use it in GitHub Desktop.
YuruToot Config
# Generated with mastodon:setup on 2022-10-17 02:08:51 UTC
# Some variables in this file will be interpreted differently whether you are
# using docker-compose or not.
LOCAL_DOMAIN=funami.tech
WEB_DOMAIN=toot.funami.tech
SINGLE_USER_MODE=false
SECRET_KEY_BASE=[CENSORED]
OTP_SECRET=[CENSORED]
VAPID_PRIVATE_KEY=[CENSORED]
VAPID_PUBLIC_KEY=[CENSORED]
DB_HOST=pgbouncer
DB_PORT=6432
DB_NAME=postgres
DB_USER=postgres
DEFAULT_LOCALE=ko
REDIS_HOST=redis
REDIS_PORT=6379
ES_ENABLED=true
ES_HOST=es
ES_PORT=9200
SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587
SMTP_LOGIN=[CENSORED]
SMTP_PASSWORD=[CENSORED]
SMTP_AUTH_METHOD=plain
SMTP_OPENSSL_VERIFY_MODE=none
SMTP_FROM_ADDRESS='YuruToot <[email protected]>'
S3_ENABLED=true
S3_BUCKET=yurutoot-storage
AWS_ACCESS_KEY_ID=[CENSORED]
AWS_SECRET_ACCESS_KEY=[CENSORED]
S3_PROTOCOL=https
S3_ALIAS_HOST=cdn.toot.funami.tech
S3_ENDPOINT=http://minio:9000
WEB_CONCURRENCY=32
MAX_THREADS=5
STREAMING_CLUSTER_NUM=8
PREPARED_STATEMENTS=false
version: '3'
services:
db:
restart: always
image: postgres:14-alpine
shm_size: 256mb
command: postgres -c "shared_preload_libraries=pg_stat_statements" -c "pg_stat_statements.track=all"
networks:
- internal_network
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- ./postgres14:/var/lib/postgresql/data
- ./postgresql.conf:/etc/postgresql.conf
environment:
- 'POSTGRES_HOST_AUTH_METHOD=trust'
pgbouncer:
restart: always
image: bitnami/pgbouncer:1
networks:
- internal_network
depends_on:
- db
ports:
- 6432:6432
environment:
- POSTGRESQL_HOST=db
- PGBOUNCER_AUTH_TYPE=trust
- PGBOUNCER_POOL_MODE=transaction
- PGBOUNCER_MAX_CLIENT_CONN=100000
- PGBOUNCER_DEFAULT_POOL_SIZE=40
redis:
restart: always
image: redis:7-alpine
networks:
- internal_network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- ./redis:/data
web:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
networks:
- external_network
- internal_network
healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
environment:
- DB_POOL=5
ports:
- '3000:3000'
depends_on:
- db
- redis
- es
- pgbouncer
volumes:
- ./public/system:/mastodon/public/system
streaming:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: node ./streaming
networks:
- external_network
- internal_network
healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
environment:
- DB_POOL=8
ports:
- '4000:4000'
depends_on:
- db
- redis
- pgbouncer
sidekiq-default:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 16 -q default"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=32
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-ingress:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 16 -q ingress"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=32
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-push:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 16 -q push"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=32
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-mailers:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 16 -q mailers"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=32
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-pull-1:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 64 -q pull"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=128
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-pull-2:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 64 -q pull"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=128
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-scheduler:
image: ghcr.io/glitch-soc/mastodon:edge
restart: always
env_file: .env.production
command: "bundle exec sidekiq -c 16 -q scheduler"
depends_on:
- db
- redis
- pgbouncer
networks:
- external_network
- internal_network
environment:
- DB_POOL=32
volumes:
- ./public/system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
es:
restart: always
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.4
environment:
- "ES_JAVA_OPTS=-Xms2560m -Xmx2560m -Des.enforce.bootstrap.checks=true"
- "xpack.license.self_generated.type=basic"
- "xpack.security.enabled=false"
- "xpack.watcher.enabled=false"
- "xpack.graph.enabled=false"
- "xpack.ml.enabled=false"
- "bootstrap.memory_lock=true"
- "cluster.name=es-mastodon"
- "discovery.type=single-node"
- "thread_pool.write.queue_size=1000"
networks:
- external_network
- internal_network
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
volumes:
- ./elasticsearch:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
minio:
restart: always
image: quay.io/minio/minio
command: server /data --console-address ":[CENSORED]"
environment:
- "MINIO_ROOT_USER=[CENSORED]"
- "MINIO_ROOT_PASSWORD=[CENSORED]"
volumes:
- /[CENSORED]:/data
ports:
- '9090:9090'
- '9000:9000'
networks:
- internal_network
- external_network
## Uncomment to enable federation with tor instances along with adding the following ENV variables
## http_proxy=http://privoxy:8118
## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
# tor:
# image: sirboops/tor
# networks:
# - external_network
# - internal_network
#
# privoxy:
# image: sirboops/privoxy
# volumes:
# - ./priv-config:/opt/config
# networks:
# - external_network
# - internal_network
networks:
external_network:
internal_network:
internal: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment