-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(service): add Mastodon #9562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
4eb321d
dd858d3
f7692d4
1085fe4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| # documentation: https://docs.joinmastodon.org/admin/install/ | ||
| # slogan: Free, open-source decentralized social media platform. | ||
| # category: social | ||
| # tags: social,fediverse,activitypub,microblogging,decentralized | ||
| # logo: svgs/mastodon.svg | ||
| # port: 3000 | ||
|
|
||
| # IMPORTANT: Before deploying, generate VAPID keys by running: | ||
| # docker run --rm ghcr.io/mastodon/mastodon:latest bundle exec rake mastodon:webpush:generate_vapid_key | ||
| # Set LOCAL_DOMAIN to your domain (e.g. mastodon.example.com) — cannot be changed after first run. | ||
|
|
||
| services: | ||
| web: | ||
| image: ghcr.io/mastodon/mastodon:latest | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please pin to a static version rather than 'latest' to prevent the template from breaking due to upstream changes. |
||
| command: bundle exec puma -C config/puma.rb | ||
| environment: | ||
| - SERVICE_URL_WEB_3000 | ||
| - LOCAL_DOMAIN=${LOCAL_DOMAIN:?} | ||
| - SECRET_KEY_BASE=${SERVICE_HEX_64_SECRETKEYBASE} | ||
| - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=${SERVICE_BASE64_32_ARDETKEY} | ||
| - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=${SERVICE_BASE64_32_ARKEYSALT} | ||
| - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=${SERVICE_BASE64_32_ARPRIMARYKEY} | ||
| - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY:?} | ||
| - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY:?} | ||
| - DB_HOST=db | ||
| - DB_PORT=5432 | ||
| - DB_NAME=${POSTGRES_DB:-mastodon_production} | ||
| - DB_USER=${SERVICE_USER_POSTGRESQL} | ||
| - DB_PASS=${SERVICE_PASSWORD_POSTGRESQL} | ||
| - REDIS_HOST=redis | ||
| - REDIS_PORT=6379 | ||
| - ES_ENABLED=false | ||
| - SMTP_SERVER=${SMTP_SERVER:-} | ||
| - SMTP_PORT=${SMTP_PORT:-587} | ||
| - SMTP_LOGIN=${SMTP_LOGIN:-} | ||
| - SMTP_PASSWORD=${SMTP_PASSWORD:-} | ||
| - SMTP_FROM_ADDRESS=${SMTP_FROM_ADDRESS:[email protected]} | ||
| volumes: | ||
| - mastodon-system:/mastodon/public/system | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
| redis: | ||
| condition: service_healthy | ||
| db-migrate: | ||
| condition: service_completed_successfully | ||
| healthcheck: | ||
| test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 10 | ||
| start_period: 30s | ||
|
|
||
| db-migrate: | ||
| image: ghcr.io/mastodon/mastodon:latest | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please pin to a static version rather than 'latest' to prevent the template from breaking due to upstream changes. |
||
| restart: "no" | ||
| command: bundle exec rake db:prepare | ||
| environment: | ||
| - LOCAL_DOMAIN=${LOCAL_DOMAIN:?} | ||
| - SECRET_KEY_BASE=${SERVICE_HEX_64_SECRETKEYBASE} | ||
| - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=${SERVICE_BASE64_32_ARDETKEY} | ||
| - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=${SERVICE_BASE64_32_ARKEYSALT} | ||
| - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=${SERVICE_BASE64_32_ARPRIMARYKEY} | ||
| - DB_HOST=db | ||
| - DB_PORT=5432 | ||
| - DB_NAME=${POSTGRES_DB:-mastodon_production} | ||
| - DB_USER=${SERVICE_USER_POSTGRESQL} | ||
| - DB_PASS=${SERVICE_PASSWORD_POSTGRESQL} | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
|
|
||
| streaming: | ||
| image: ghcr.io/mastodon/mastodon-streaming:latest | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please pin to a static version rather than 'latest' to prevent the template from breaking due to upstream changes. |
||
| command: node ./streaming/index.js | ||
| environment: | ||
| - NODE_ENV=production | ||
| - BIND=0.0.0.0 | ||
| - DB_HOST=db | ||
| - DB_PORT=5432 | ||
| - DB_NAME=${POSTGRES_DB:-mastodon_production} | ||
| - DB_USER=${SERVICE_USER_POSTGRESQL} | ||
| - DB_PASS=${SERVICE_PASSWORD_POSTGRESQL} | ||
| - REDIS_HOST=redis | ||
| - REDIS_PORT=6379 | ||
| - SECRET_KEY_BASE=${SERVICE_HEX_64_SECRETKEYBASE} | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
| redis: | ||
| condition: service_healthy | ||
| healthcheck: | ||
| test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 10 | ||
|
|
||
| sidekiq: | ||
| image: ghcr.io/mastodon/mastodon:latest | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please pin to a static version rather than 'latest' to prevent the template from breaking due to upstream changes. |
||
| command: bundle exec sidekiq | ||
| environment: | ||
| - LOCAL_DOMAIN=${LOCAL_DOMAIN:?} | ||
| - SECRET_KEY_BASE=${SERVICE_HEX_64_SECRETKEYBASE} | ||
| - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=${SERVICE_BASE64_32_ARDETKEY} | ||
| - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=${SERVICE_BASE64_32_ARKEYSALT} | ||
| - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=${SERVICE_BASE64_32_ARPRIMARYKEY} | ||
| - DB_HOST=db | ||
| - DB_PORT=5432 | ||
| - DB_NAME=${POSTGRES_DB:-mastodon_production} | ||
| - DB_USER=${SERVICE_USER_POSTGRESQL} | ||
| - DB_PASS=${SERVICE_PASSWORD_POSTGRESQL} | ||
| - REDIS_HOST=redis | ||
| - REDIS_PORT=6379 | ||
| - ES_ENABLED=false | ||
| - SMTP_SERVER=${SMTP_SERVER:-} | ||
| - SMTP_PORT=${SMTP_PORT:-587} | ||
| - SMTP_LOGIN=${SMTP_LOGIN:-} | ||
| - SMTP_PASSWORD=${SMTP_PASSWORD:-} | ||
| - SMTP_FROM_ADDRESS=${SMTP_FROM_ADDRESS:[email protected]} | ||
| volumes: | ||
| - mastodon-system:/mastodon/public/system | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
| redis: | ||
| condition: service_healthy | ||
| healthcheck: | ||
| test: ['CMD-SHELL', "ps aux | grep '[s]idekiq 8' || false"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 10 | ||
|
|
||
| db: | ||
| image: postgres:14-alpine | ||
| shm_size: 256mb | ||
| environment: | ||
| - POSTGRES_DB=${POSTGRES_DB:-mastodon_production} | ||
| - POSTGRES_USER=${SERVICE_USER_POSTGRESQL} | ||
| - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL} | ||
| volumes: | ||
| - db-data:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB:-mastodon_production}"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 10 | ||
|
|
||
| redis: | ||
| image: redis:7-alpine | ||
| volumes: | ||
| - redis-data:/data | ||
| healthcheck: | ||
| test: ['CMD', 'redis-cli', 'ping'] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 10 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a helper service similar to the
kibana-token-generatoron https://github.com/coollabsio/coolify/blob/v4.x/templates/compose/elasticsearch-with-kibana.yaml and clearly mention the steps on docs like this: https://coolify.io/docs/services/elasticsearch#deploy-elasticsearch-with-kibana