docker-compose.yml 3.5 KB

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