/ docker-compose.yml
docker-compose.yml
 1  version: '3.8'
 2  
 3  services:
 4    postgres:
 5      image: postgres:16
 6      container_name: echo_postgres
 7      environment:
 8        POSTGRES_USER: postgres
 9        POSTGRES_PASSWORD: postgres
10        POSTGRES_DB: echo_org
11      ports:
12        - "5433:5432"
13      volumes:
14        - postgres_data:/var/lib/postgresql/data
15      healthcheck:
16        test: ["CMD-SHELL", "pg_isready -U postgres"]
17        interval: 5s
18        timeout: 5s
19        retries: 5
20  
21    redis:
22      image: redis:7-alpine
23      container_name: echo_redis
24      ports:
25        - "6383:6383"
26      command: redis-server --port 6383
27      volumes:
28        - redis_data:/data
29      healthcheck:
30        test: ["CMD", "redis-cli", "-p", "6383", "ping"]
31        interval: 5s
32        timeout: 5s
33        retries: 5
34  
35  volumes:
36    postgres_data:
37    redis_data: