docker-compose.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. ports:
  33. - ${WEB_HOST_PORT}:3000
  34. webpack_dev_server:
  35. <<: *app
  36. command: bin/webpack-dev-server --public 0.0.0.0
  37. environment:
  38. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  39. ports:
  40. - 3035:3035
  41. relay-compiler:
  42. <<: *app
  43. command: yarn run relay --watch
  44. db:
  45. image: postgres:11.2-alpine
  46. environment:
  47. - POSTGRES_DB
  48. - POSTGRES_PASSWORD
  49. - POSTGRES_USER
  50. ports:
  51. - ${DB_HOST_PORT}:5432
  52. volumes:
  53. - postgres-persisted-volume:/var/lib/postgresql/data
  54. volumes:
  55. postgres-persisted-volume:
  56. gems:
  57. node_modules: