version: '3' services: pgsql: image: 'postgres:16' ports: - '5432:5432' environment: PGPASSWORD: '${DB_PASSWORD:-secret}' POSTGRES_DB: codes POSTGRES_USER: root POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}' volumes: - './data:/var/lib/postgresql/data' healthcheck: test: - CMD - pg_isready - '-q' - '-d' - '${DB_DATABASE}' - '-U' - '${DB_USERNAME}' retries: 3 timeout: 5s