1
0

docker-compose.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. # You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes
  57. # build: .
  58. image: ghcr.io/mastodon/mastodon:v4.3.0
  59. restart: always
  60. env_file: .env.production
  61. command: bundle exec puma -C config/puma.rb
  62. networks:
  63. - external_network
  64. - internal_network
  65. healthcheck:
  66. # prettier-ignore
  67. test: ['CMD-SHELL',"curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1"]
  68. ports:
  69. - '127.0.0.1:3000:3000'
  70. depends_on:
  71. - db
  72. - redis
  73. # - es
  74. volumes:
  75. - ./public/system:/mastodon/public/system
  76. streaming:
  77. # You can uncomment the following lines if you want to not use the prebuilt image, for example if you have local code changes
  78. # build:
  79. # dockerfile: ./streaming/Dockerfile
  80. # context: .
  81. image: ghcr.io/mastodon/mastodon-streaming:v4.3.0
  82. restart: always
  83. env_file: .env.production
  84. command: node ./streaming/index.js
  85. networks:
  86. - external_network
  87. - internal_network
  88. healthcheck:
  89. # prettier-ignore
  90. test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1"]
  91. ports:
  92. - '127.0.0.1:4000:4000'
  93. depends_on:
  94. - db
  95. - redis
  96. sidekiq:
  97. build: .
  98. image: ghcr.io/mastodon/mastodon:v4.3.0
  99. restart: always
  100. env_file: .env.production
  101. command: bundle exec sidekiq
  102. depends_on:
  103. - db
  104. - redis
  105. networks:
  106. - external_network
  107. - internal_network
  108. volumes:
  109. - ./public/system:/mastodon/public/system
  110. healthcheck:
  111. test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
  112. ## Uncomment to enable federation with tor instances along with adding the following ENV variables
  113. ## http_hidden_proxy=http://privoxy:8118
  114. ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
  115. # tor:
  116. # image: sirboops/tor
  117. # networks:
  118. # - external_network
  119. # - internal_network
  120. #
  121. # privoxy:
  122. # image: sirboops/privoxy
  123. # volumes:
  124. # - ./priv-config:/opt/config
  125. # networks:
  126. # - external_network
  127. # - internal_network
  128. networks:
  129. external_network:
  130. internal_network:
  131. internal: true