docker-compose.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
  24. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  25. ports:
  26. - ${WEB_HOST_PORT}:3000
  27. webpack_dev_server:
  28. <<: *app
  29. command: bin/webpack-dev-server --public 0.0.0.0
  30. entrypoint: config/docker/rails-dev-entrypoint.sh
  31. environment:
  32. - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
  33. ports:
  34. - 3035:3035
  35. db:
  36. image: postgres:11.2-alpine
  37. environment:
  38. - POSTGRES_DB
  39. - POSTGRES_PASSWORD
  40. - POSTGRES_USER
  41. ports:
  42. - ${DB_HOST_PORT}:5432
  43. volumes:
  44. - postgres-persisted-volume:/var/lib/postgresql/data
  45. volumes:
  46. postgres-persisted-volume:
  47. gems:
  48. node_modules: