docker-compose.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. version: '3'
  2. services:
  3. db:
  4. restart: always
  5. image: postgres:9.6-alpine
  6. networks:
  7. - internal_network
  8. healthcheck:
  9. test: ["CMD", "pg_isready", "-U", "postgres"]
  10. volumes:
  11. - ./postgres:/var/lib/postgresql/data
  12. redis:
  13. restart: always
  14. image: redis:4.0-alpine
  15. networks:
  16. - internal_network
  17. healthcheck:
  18. test: ["CMD", "redis-cli", "ping"]
  19. volumes:
  20. - ./redis:/data
  21. # es:
  22. # restart: always
  23. # image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.1.3
  24. # environment:
  25. # - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
  26. # networks:
  27. # - internal_network
  28. # healthcheck:
  29. # test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
  30. # volumes:
  31. # - ./elasticsearch:/usr/share/elasticsearch/data
  32. web:
  33. build: .
  34. image: tootsuite/mastodon
  35. restart: always
  36. env_file: .env.production
  37. command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000 -b '0.0.0.0'"
  38. networks:
  39. - external_network
  40. - internal_network
  41. healthcheck:
  42. test: ["CMD-SHELL", "wget -q --spider --header 'x-forwarded-proto: https' --proxy off localhost:3000/api/v1/instance || exit 1"]
  43. ports:
  44. - "127.0.0.1:3000:3000"
  45. depends_on:
  46. - db
  47. - redis
  48. # - es
  49. volumes:
  50. - ./public/system:/mastodon/public/system
  51. streaming:
  52. build: .
  53. image: tootsuite/mastodon
  54. restart: always
  55. env_file: .env.production
  56. command: yarn start
  57. networks:
  58. - external_network
  59. - internal_network
  60. healthcheck:
  61. test: ["CMD-SHELL", "wget -q --spider --header 'x-forwarded-proto: https' --proxy off localhost:4000/api/v1/streaming/health || exit 1"]
  62. ports:
  63. - "127.0.0.1:4000:4000"
  64. depends_on:
  65. - db
  66. - redis
  67. sidekiq:
  68. build: .
  69. image: tootsuite/mastodon
  70. restart: always
  71. env_file: .env.production
  72. command: bundle exec sidekiq
  73. depends_on:
  74. - db
  75. - redis
  76. networks:
  77. - external_network
  78. - internal_network
  79. volumes:
  80. - ./public/system:/mastodon/public/system
  81. ## Uncomment to enable federation with tor instances along with adding the following ENV variables
  82. ## http_proxy=http://privoxy:8118
  83. ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
  84. # tor:
  85. # image: sirboops/tor
  86. # networks:
  87. # - external_network
  88. # - internal_network
  89. #
  90. # privoxy:
  91. # image: sirboops/privoxy
  92. # volumes:
  93. # - ./priv-config:/opt/config
  94. # networks:
  95. # - external_network
  96. # - internal_network
  97. networks:
  98. external_network:
  99. internal_network:
  100. internal: true