GitHub Workflow Services getting Connection Refused

Hello Experts,

I have been trying to access a Docker container run as a service in the GitHub Workflow but can’t connect to it. I am always getting “Connection refused” errors. This is the workflow. Can somebody help?

name: 'Upload Media'

on:
  workflow_dispatch:
  schedule:
    - cron: '0 */12 * * *'

jobs:
  upload_media:
    name: Run Instagram Upload Media Tool
    runs-on: ubuntu-latest

    services:
      api:
        image: adw0rd/instagrapi-rest
        ports:
          - 8001:8000

    steps:
      - name: Sleep for 60 seconds
        run: sleep 60s
        shell: bash
      - run: |
          curl -X 'GET' 'http://localhost:8001/auth/login' -H 'accept: application/json' -H 'Content-Type: application/x-www-form-urlencoded' -d 'username=${{ secrets.INSTAGRAM_USERNAME }}&password=${{ secrets.INSTAGRAM_PASSWORD }}'
curl: (7) Failed to connect to localhost port 8001: Connection refused