services: backend: image: ken027/url-shortener-api container_name: url-shortener-api build: context: . dockerfile: Dockerfile ports: - "5000:5000" env_file: - .env depends_on: postgres: condition: service_started postgres: image: postgres container_name: url_shortener_db env_file: - .env ports: - "5433:5432" volumes: - url_shortener_postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 30s timeout: 10s retries: 3 restart: unless-stopped volumes: url_shortener_postgres_data: driver: local