services: messages_db: image: postgres:latest environment: - POSTGRES_USER=${POSTGRES_USER:-postgres} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} - POSTGRES_DB=${POSTGRES_DB:-messages} ports: - "5432:5432" volumes: - data:/var/lib/postgresql healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-messages}"] interval: 5s timeout: 5s retries: 5 start_period: 10s env_file: - .env volumes: data: