docker-compose.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. version: '3'
  2. services:
  3. db:
  4. restart: always
  5. image: postgres:14-alpine
  6. shm_size: 256mb
  7. networks:
  8. - internal_network
  9. healthcheck:
  10. test: ['CMD', 'pg_isready', '-U', 'postgres']
  11. volumes:
  12. - ./postgres14:/var/lib/postgresql/data
  13. environment:
  14. - 'POSTGRES_HOST_AUTH_METHOD=trust'
  15. redis:
  16. restart: always
  17. image: redis:7-alpine
  18. networks:
  19. - internal_network
  20. healthcheck:
  21. test: ['CMD', 'redis-cli', 'ping']
  22. volumes:
  23. - ./redis:/data
  24. # es:
  25. # restart: always
  26. # image: docker.elastic.co/elasticsearch/elasticsearch:7.17.4
  27. # environment:
  28. # - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.enforce.bootstrap.checks=true"
  29. # - "xpack.license.self_generated.type=basic"
  30. # - "xpack.security.enabled=false"
  31. # - "xpack.watcher.enabled=false"
  32. # - "xpack.graph.enabled=false"
  33. # - "xpack.ml.enabled=false"
  34. # - "bootstrap.memory_lock=true"
  35. # - "cluster.name=es-mastodon"
  36. # - "discovery.type=single-node"
  37. # - "thread_pool.write.queue_size=1000"
  38. # networks:
  39. # - external_network
  40. # - internal_network
  41. # healthcheck:
  42. # test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
  43. # volumes:
  44. # - ./elasticsearch:/usr/share/elasticsearch/data
  45. # ulimits:
  46. # memlock:
  47. # soft: -1
  48. # hard: -1
  49. # nofile:
  50. # soft: 65536
  51. # hard: 65536
  52. # ports:
  53. # - '127.0.0.1:9200:9200'
  54. web:
  55. build: .
  56. image: tootsuite/mastodon
  57. restart: always
  58. env_file: .env.production
  59. command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
  60. networks:
  61. - external_network
  62. - internal_network
  63. healthcheck:
  64. # prettier-ignore
  65. test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
  66. ports:
  67. - '127.0.0.1:3000:3000'
  68. depends_on:
  69. - db
  70. - redis
  71. # - es
  72. volumes:
  73. - ./public/system:/mastodon/public/system
  74. streaming:
  75. build: .
  76. image: tootsuite/mastodon
  77. restart: always
  78. env_file: .env.production
  79. command: node ./streaming
  80. networks:
  81. - external_network
  82. - internal_network
  83. healthcheck:
  84. # prettier-ignore
  85. test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
  86. ports:
  87. - '127.0.0.1:4000:4000'
  88. depends_on:
  89. - db
  90. - redis
  91. sidekiq:
  92. build: .
  93. image: tootsuite/mastodon
  94. restart: always
  95. env_file: .env.production
  96. command: bundle exec sidekiq
  97. depends_on:
  98. - db
  99. - redis
  100. networks:
  101. - external_network
  102. - internal_network
  103. volumes:
  104. - ./public/system:/mastodon/public/system
  105. healthcheck:
  106. test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
  107. ## Uncomment to enable federation with tor instances along with adding the following ENV variables
  108. ## http_proxy=http://privoxy:8118
  109. ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
  110. # tor:
  111. # image: sirboops/tor
  112. # networks:
  113. # - external_network
  114. # - internal_network
  115. #
  116. # privoxy:
  117. # image: sirboops/privoxy
  118. # volumes:
  119. # - ./priv-config:/opt/config
  120. # networks:
  121. # - external_network
  122. # - internal_network
  123. networks:
  124. external_network:
  125. internal_network:
  126. internal: true