Were you able to fix it?
cURL error 28: Connection timeout after 10001
I'm using laravel and I have wsl 2 and docker. What I have is 2 containers with identical code. What I'm trying to do is get my one container to talk to the other. So for example if in my code I do something like Http::get(http://172.26.0.4:8090), where 172.26.0.4:8090 is the second container, then I should be able to go there and see the page or at least hit the function. The problem I'm having is that when I do Http::get(http://172.26.0.4:8090) I get the error
cURL error 28: Connection timeout after 10001 ms (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://172.26.0.4:8090
I'm not sure what I need to do to sort this out. This is my compose.yml file for the first container
# For more information: https://laravel.com/docs/sail
version: '3'
services:
app:
build:
context: ./support/runtime
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: wise-owl/app:8.2
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${FORWARD_APP_PORT:-80}:80'
- '${FORWARD_HMR_PORT:-8080}:8080'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
- test_network
depends_on:
- pgsql.wo
- redis
pgsql.wo:
image: 'postgres:15.2'
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'sail-pgsql-wo:/var/lib/postgresql/data'
- '.:/var/www/html'
networks:
- sail
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}" ]
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'sail-redis:/data'
networks:
- sail
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
retries: 3
timeout: 5s
networks:
sail:
driver: bridge
test_network:
driver: bridge
volumes:
sail-pgsql-wo:
driver: local
sail-redis:
driver: local
and this is the compose.yml file for the second one
# For more information: https://laravel.com/docs/sail
version: '3'
services:
wise-owl-api:
build:
context: ./support/runtime
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: wise-owl/app:8.2
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${FORWARD_APP_PORT:-80}:80'
- '${FORWARD_HMR_PORT:-8080}:8080'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
- test_network
depends_on:
- pgsql.wo
- redis
pgsql.wo:
image: 'postgres:15.2'
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'sail-pgsql-wo:/var/lib/postgresql/data'
- '.:/var/www/html'
networks:
- sail
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}" ]
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'sail-redis:/data'
networks:
- sail
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
retries: 3
timeout: 5s
networks:
sail:
driver: bridge
test_network:
driver: bridge
volumes:
sail-pgsql-wo:
driver: local
sail-redis:
driver: local
Please or to participate in this conversation.