docker-compose.yml 857 B

123456789101112131415161718192021222324252627282930313233
  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. entrypoint: config/docker/rails-entrypoint.sh
  13. environment:
  14. - DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/pokemon_trade_dev
  15. ports:
  16. - ${WEB_HOST_PORT}:3000
  17. volumes:
  18. - type: bind
  19. source: .
  20. target: /app
  21. working_dir: /app
  22. db:
  23. environment:
  24. - POSTGRES_PASSWORD
  25. image: postgres:11.2-alpine
  26. ports:
  27. - ${DB_HOST_PORT}:5432
  28. volumes:
  29. - postgres-persisted-volume:/var/lib/postgresql/data
  30. volumes:
  31. postgres-persisted-volume: