docker-compose.yml 807 B

1234567891011121314151617181920212223242526272829303132
  1. version: "3.7"
  2. services:
  3. web:
  4. build:
  5. context: .
  6. target: builder
  7. # Even though CMD is defined in the Dockerfile, we need to provide a CMD here
  8. # because we are using a compose entrypoint. See https://github.com/docker/compose/issues/3140
  9. command: rails server -p 3000 -b 0.0.0.0
  10. depends_on:
  11. - db
  12. environment:
  13. - DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/pokemon_trade_dev
  14. ports:
  15. - ${WEB_HOST_PORT}:3000
  16. volumes:
  17. - type: bind
  18. source: .
  19. target: /app
  20. working_dir: /app
  21. db:
  22. environment:
  23. - POSTGRES_PASSWORD
  24. image: postgres:11.2-alpine
  25. ports:
  26. - ${DB_HOST_PORT}:5432
  27. volumes:
  28. - postgres-persisted-volume:/var/lib/postgresql/data
  29. volumes:
  30. postgres-persisted-volume: