docker-compose.yml 1.0 KB

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