docker-compose.postgres.yml 787 B

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