docker-compose.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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:6-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-oss:7.10.2
  27. # environment:
  28. # - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
  29. # - "cluster.name=es-mastodon"
  30. # - "discovery.type=single-node"
  31. # - "bootstrap.memory_lock=true"
  32. # networks:
  33. # - internal_network
  34. # healthcheck:
  35. # test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
  36. # volumes:
  37. # - ./elasticsearch:/usr/share/elasticsearch/data
  38. # ulimits:
  39. # memlock:
  40. # soft: -1
  41. # hard: -1
  42. web:
  43. build: .
  44. image: tootsuite/mastodon
  45. restart: always
  46. env_file: .env.production
  47. command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
  48. networks:
  49. - external_network
  50. - internal_network
  51. healthcheck:
  52. # prettier-ignore
  53. test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
  54. ports:
  55. - '127.0.0.1:3000:3000'
  56. depends_on:
  57. - db
  58. - redis
  59. # - es
  60. volumes:
  61. - ./public/system:/mastodon/public/system
  62. streaming:
  63. build: .
  64. image: tootsuite/mastodon
  65. restart: always
  66. env_file: .env.production
  67. command: node ./streaming
  68. networks:
  69. - external_network
  70. - internal_network
  71. healthcheck:
  72. # prettier-ignore
  73. test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
  74. ports:
  75. - '127.0.0.1:4000:4000'
  76. depends_on:
  77. - db
  78. - redis
  79. sidekiq:
  80. build: .
  81. image: tootsuite/mastodon
  82. restart: always
  83. env_file: .env.production
  84. command: bundle exec sidekiq
  85. depends_on:
  86. - db
  87. - redis
  88. networks:
  89. - external_network
  90. - internal_network
  91. volumes:
  92. - ./public/system:/mastodon/public/system
  93. healthcheck:
  94. test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
  95. ## Uncomment to enable federation with tor instances along with adding the following ENV variables
  96. ## http_proxy=http://privoxy:8118
  97. ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
  98. # tor:
  99. # image: sirboops/tor
  100. # networks:
  101. # - external_network
  102. # - internal_network
  103. #
  104. # privoxy:
  105. # image: sirboops/privoxy
  106. # volumes:
  107. # - ./priv-config:/opt/config
  108. # networks:
  109. # - external_network
  110. # - internal_network
  111. networks:
  112. external_network:
  113. internal_network:
  114. internal: true