1
0

docker-compose.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: '14'
  14. volumes:
  15. - ..:/workspaces/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. # Overrides default command so things don't shut down after the process ends.
  29. command: sleep infinity
  30. networks:
  31. - external_network
  32. - internal_network
  33. user: vscode
  34. db:
  35. image: postgres:14-alpine
  36. restart: unless-stopped
  37. volumes:
  38. - postgres-data:/var/lib/postgresql/data
  39. environment:
  40. POSTGRES_USER: postgres
  41. POSTGRES_DB: postgres
  42. POSTGRES_PASSWORD: postgres
  43. POSTGRES_HOST_AUTH_METHOD: trust
  44. networks:
  45. - internal_network
  46. redis:
  47. image: redis:6-alpine
  48. restart: unless-stopped
  49. volumes:
  50. - redis-data:/data
  51. networks:
  52. - internal_network
  53. es:
  54. image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
  55. restart: unless-stopped
  56. environment:
  57. ES_JAVA_OPTS: -Xms512m -Xmx512m
  58. cluster.name: es-mastodon
  59. discovery.type: single-node
  60. bootstrap.memory_lock: 'true'
  61. volumes:
  62. - es-data:/usr/share/elasticsearch/data
  63. networks:
  64. - internal_network
  65. ulimits:
  66. memlock:
  67. soft: -1
  68. hard: -1
  69. volumes:
  70. postgres-data:
  71. redis-data:
  72. es-data:
  73. networks:
  74. external_network:
  75. internal_network:
  76. internal: true