I’m facing a problem with port connectivity when running Docker containers in GitHub Actions. My configuration works flawlessly on local machines but encounters issues during the CI pipeline execution.
The error message I’m receiving is:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=6789): Max retries exceeded with url: /api/v1/users (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3d28e3d810>: Failed to establish a new connection: [Errno 111] Connection refused'))
This is my Docker Compose setup:
workflow_service:
image: docker.n8n.io/n8nio/n8n
ports:
- "6789:5678"
environment:
- N8N_HOST=workflow_service:5678
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- DB_TYPE=postgresdb
- DB_TABLE_PREFIX=workflow_
- DB_POSTGRESDB_DATABASE=workflow_db
volumes:
- ./config/workflow/data:/home/node/.n8n
- ./config/workflow/files:/files
I’m trying to reach this service from a Django application using Python’s requests library. The configuration is consistent between local and CI environments.
I’ve verified with minimal curl commands that while other services on different ports are functioning correctly, this particular service consistently fails with connection refused errors in GitHub Actions.