Skip to content

Instantly share code, notes, and snippets.

@insom
Created January 2, 2023 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insom/e18fa0d71f9a6ca221fbff3eb6171ffc to your computer and use it in GitHub Desktop.
Save insom/e18fa0d71f9a6ca221fbff3eb6171ffc to your computer and use it in GitHub Desktop.
Docker Compose for Mastodon
version: '3'
services:
web:
build: .
image: tootsuite/mastodon
network_mode: host
ulimits:
as:
hard: 6192000000
soft: 6048000000
restart: always
env_file: env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
logging:
options:
max-size: 50m
streaming:
build: .
image: tootsuite/mastodon
network_mode: host
restart: always
env_file: env.production
command: node ./streaming
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
logging:
options:
max-size: 50m
sidekiq:
build: .
image: tootsuite/mastodon
network_mode: host
restart: always
env_file: env.production
command: bundle exec sidekiq -c 25 -q push -q pull -q ingress -q default -q mailers
logging:
options:
max-size: 50m
version: '3'
services:
redis:
restart: always
image: redis:5.0-alpine
network_mode: host
healthcheck:
test: ["CMD", "redis-cli", "ping"]
es:
restart: always
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
network_mode: host
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "cluster.name=es-mastodon"
- "discovery.type=single-node"
- "bootstrap.memory_lock=true"
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
volumes:
- /home/insom/Repo/mastodon/elasticsearch:/usr/share/elasticsearch/data
ulimits:
memlock:
hard: -1
soft: -1
web:
build: .
image: tootsuite/mastodon
network_mode: host
ulimits:
as:
hard: 6192000000
soft: 6048000000
restart: always
env_file: env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
logging:
options:
max-size: 50m
streaming:
build: .
image: tootsuite/mastodon
network_mode: host
restart: always
env_file: env.production
command: node ./streaming
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
logging:
options:
max-size: 50m
sidekiq:
build: .
image: tootsuite/mastodon
network_mode: host
restart: always
env_file: env.production
command: bundle exec sidekiq -c 25
logging:
options:
max-size: 50m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment