docker-compose.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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=0.0.0.0
  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. entrypoint: config/docker/rails-dev-entrypoint.sh
  38. environment:
  39. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  40. ports:
  41. - 3035:3035
  42. db:
  43. image: postgres:11.2-alpine
  44. environment:
  45. - POSTGRES_DB
  46. - POSTGRES_PASSWORD
  47. - POSTGRES_USER
  48. ports:
  49. - ${DB_HOST_PORT}:5432
  50. volumes:
  51. - postgres-persisted-volume:/var/lib/postgresql/data
  52. volumes:
  53. postgres-persisted-volume:
  54. gems:
  55. node_modules: