docker-compose.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. version: '3'
  2. services:
  3. app:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile
  7. args:
  8. # Update 'VARIANT' to pick a version of Ruby: 3, 3.1, 3.0, 2, 2.7, 2.6
  9. # Append -bullseye or -buster to pin to an OS version.
  10. # Use -bullseye variants on local arm64/Apple Silicon.
  11. VARIANT: '3.0-bullseye'
  12. # Optional Node.js version to install
  13. NODE_VERSION: '16'
  14. volumes:
  15. - ..:/mastodon:cached
  16. environment:
  17. RAILS_ENV: development
  18. NODE_ENV: development
  19. REDIS_HOST: redis
  20. REDIS_PORT: '6379'
  21. DB_HOST: db
  22. DB_USER: postgres
  23. DB_PASS: postgres
  24. DB_PORT: '5432'
  25. ES_ENABLED: 'true'
  26. ES_HOST: es
  27. ES_PORT: '9200'
  28. LIBRE_TRANSLATE_ENDPOINT: http://libretranslate:5000
  29. # Overrides default command so things don't shut down after the process ends.
  30. command: sleep infinity
  31. networks:
  32. - external_network
  33. - internal_network
  34. user: vscode
  35. db:
  36. image: postgres:14-alpine
  37. restart: unless-stopped
  38. volumes:
  39. - postgres-data:/var/lib/postgresql/data
  40. environment:
  41. POSTGRES_USER: postgres
  42. POSTGRES_DB: postgres
  43. POSTGRES_PASSWORD: postgres
  44. POSTGRES_HOST_AUTH_METHOD: trust
  45. networks:
  46. - internal_network
  47. redis:
  48. image: redis:6-alpine
  49. restart: unless-stopped
  50. volumes:
  51. - redis-data:/data
  52. networks:
  53. - internal_network
  54. es:
  55. image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
  56. restart: unless-stopped
  57. environment:
  58. ES_JAVA_OPTS: -Xms512m -Xmx512m
  59. cluster.name: es-mastodon
  60. discovery.type: single-node
  61. bootstrap.memory_lock: 'true'
  62. volumes:
  63. - es-data:/usr/share/elasticsearch/data
  64. networks:
  65. - internal_network
  66. ulimits:
  67. memlock:
  68. soft: -1
  69. hard: -1
  70. libretranslate:
  71. image: libretranslate/libretranslate:v1.2.9
  72. restart: unless-stopped
  73. networks:
  74. - internal_network
  75. volumes:
  76. postgres-data:
  77. redis-data:
  78. es-data:
  79. networks:
  80. external_network:
  81. internal_network:
  82. internal: true