docker-compose.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. version: "3.7"
  2. x-app:
  3. &app
  4. build:
  5. context: .
  6. target: dev
  7. entrypoint: config/docker/rails-dev-entrypoint.sh
  8. volumes:
  9. - type: bind
  10. source: .
  11. target: /app
  12. - type: bind
  13. source: ./config/database.yml.docker
  14. target: /app/config/database.yml
  15. - gems:/usr/local/bundle
  16. - node_modules:/app/node_modules
  17. working_dir: /app
  18. services:
  19. web:
  20. <<: *app
  21. command: rails server -p 3000 -b 0.0.0.0
  22. depends_on:
  23. - db
  24. - webpack_dev_server
  25. environment:
  26. - POSTGRES_DB
  27. - POSTGRES_HOST=db
  28. - POSTGRES_PASSWORD
  29. - POSTGRES_PORT=5432
  30. - POSTGRES_USER
  31. - WEBPACKER_DEV_SERVER_HOST=webpack_dev_server
  32. - REDIS_URL=redis://redis:6379
  33. ports:
  34. - ${WEB_HOST_PORT}:3000
  35. webpack_dev_server:
  36. <<: *app
  37. command: bin/webpack-dev-server --public 0.0.0.0
  38. environment:
  39. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  40. ports:
  41. - 3035:3035
  42. relay-compiler:
  43. <<: *app
  44. command: yarn run relay --watch
  45. redis:
  46. image: redis:5.0.7-alpine
  47. ports:
  48. - ${REDIS_HOST_PORT}:6379
  49. db:
  50. image: postgres:12.1-alpine
  51. environment:
  52. - POSTGRES_DB
  53. - POSTGRES_PASSWORD
  54. - POSTGRES_USER
  55. ports:
  56. - ${DB_HOST_PORT}:5432
  57. volumes:
  58. - postgres-persisted-volume:/var/lib/postgresql/data
  59. volumes:
  60. postgres-persisted-volume:
  61. gems:
  62. node_modules: