From bf8318457973f0ceb654be039ae42014719bbd67 Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Sun, 16 Feb 2025 21:17:24 +0200 Subject: [PATCH] Add mastodon --- mastodon/README.md | 7 +++ mastodon/docker-compose.yaml | 83 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 mastodon/README.md create mode 100644 mastodon/docker-compose.yaml diff --git a/mastodon/README.md b/mastodon/README.md new file mode 100644 index 0000000..62f2b39 --- /dev/null +++ b/mastodon/README.md @@ -0,0 +1,7 @@ +# mastodon + +Your self-hosted, globally interconnected microblogging community + +## Important step when deploying + +Set the environment variables according to https://docs.joinmastodon.org/admin/config/ diff --git a/mastodon/docker-compose.yaml b/mastodon/docker-compose.yaml new file mode 100644 index 0000000..18af972 --- /dev/null +++ b/mastodon/docker-compose.yaml @@ -0,0 +1,83 @@ +version: '3.3' + +services: + db: + restart: unless-stopped + image: postgres:${postgres_version:-14-alpine} + shm_size: 256mb + networks: + - internal_network + healthcheck: + test: ['CMD', 'pg_isready', '-U', 'postgres'] + volumes: + - postgres:/var/lib/postgresql/data + environment: + - 'POSTGRES_USER=mastodon' + - 'POSTGRES_PASSWORD=mastodon' + - 'POSTGRES_DB=mastodon' + + redis: + restart: unless-stopped + image: redis:${redis_version} + networks: + - internal_network + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] + volumes: + - redis:/data + + web: + image: ghcr.io/mastodon/mastodon:${mastodon_version} + restart: unless-stopped + env_file: ../stack.env + command: bundle exec puma -C config/puma.rb + networks: + - external_network + - internal_network + healthcheck: + test: ['CMD-SHELL',"curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1"] + depends_on: + - db + - redis + volumes: + - system:/mastodon/public/system + + streaming: + image: ghcr.io/mastodon/mastodon-streaming:${mastodon_version} + restart: unless-stopped + env_file: ../stack.env + command: node ./streaming/index.js + networks: + - external_network + - internal_network + healthcheck: + test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1"] + depends_on: + - db + - redis + + sidekiq: + image: ghcr.io/mastodon/mastodon:${mastodon_version} + restart: unless-stopped + env_file: ../stack.env + command: bundle exec sidekiq + depends_on: + - db + - redis + networks: + - external_network + - internal_network + volumes: + - system:/mastodon/public/system + healthcheck: + test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] + +networks: + external_network: + internal_network: + internal: true + +volumes: + system: + redis: + postgres: