docker-compose.postgres.yml 837 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. services:
  2. server:
  3. build:
  4. context: .
  5. volumes:
  6. - custom:/app/custom
  7. environment:
  8. DB_CLIENT: pg
  9. DB_HOST: postgres
  10. REDIS_ENABLED: true
  11. REDIS_HOST: redis
  12. REDIS_PORT: 6379
  13. ports:
  14. - 3000:3000
  15. depends_on:
  16. postgres:
  17. condition: service_healthy
  18. redis:
  19. condition: service_started
  20. postgres:
  21. image: postgres
  22. restart: always
  23. user: ${DB_USER}
  24. volumes:
  25. - db_data_pg:/var/lib/postgresql/data
  26. environment:
  27. POSTGRES_DB: ${DB_NAME}
  28. POSTGRES_PASSWORD: ${DB_PASSWORD}
  29. expose:
  30. - 5432
  31. healthcheck:
  32. test: [ "CMD", "pg_isready" ]
  33. interval: 10s
  34. timeout: 5s
  35. retries: 5
  36. redis:
  37. image: redis:alpine
  38. restart: always
  39. expose:
  40. - 6379
  41. volumes:
  42. db_data_pg:
  43. custom: