docker-compose.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. - gems:/usr/local/bundle
  13. - node_modules:/app/node_modules
  14. working_dir: /app
  15. services:
  16. web:
  17. <<: *app
  18. command: rails server -p 3000 -b 0.0.0.0
  19. depends_on:
  20. - db
  21. - webpack_dev_server
  22. environment:
  23. - POSTGRES_DB
  24. - POSTGRES_HOST=db
  25. - POSTGRES_PASSWORD
  26. - POSTGRES_PORT=5432
  27. - POSTGRES_USER
  28. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  29. ports:
  30. - ${WEB_HOST_PORT}:3000
  31. webpack_dev_server:
  32. <<: *app
  33. command: bin/webpack-dev-server --public 0.0.0.0
  34. entrypoint: config/docker/rails-dev-entrypoint.sh
  35. environment:
  36. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  37. ports:
  38. - 3035:3035
  39. db:
  40. image: postgres:11.2-alpine
  41. environment:
  42. - POSTGRES_DB
  43. - POSTGRES_PASSWORD
  44. - POSTGRES_USER
  45. ports:
  46. - ${DB_HOST_PORT}:5432
  47. volumes:
  48. - postgres-persisted-volume:/var/lib/postgresql/data
  49. volumes:
  50. postgres-persisted-volume:
  51. gems:
  52. node_modules: