#community-help

Resolving Docker Error with Wordpress

TLDR john was experiencing an error with Docker and Wordpress. Jason advised using a special hostname to enable connectivity between Wordpress and Typesense containers.

Powered by Struct AI
3
13mo
Solved
Join the chat
Sep 16, 2022 (13 months ago)
john
Photo of md5-8580135584bd6fa853df7106a84c1fe2
john
01:15 PM
docker is used now, but still error with wordpress:
=== START ====
::Time:: 2022-09-16::13:12:00-UTC
WP_Error::__set_state(array(
   'errors' => 
  array (
    'http_request_failed' => 
    array (
      0 => 'cURL error 7: Failed to connect to localhost port 8108: Connection refused',
    ),
  ),
   'error_data' => 
  array (
  ),
   'additional_data' => 
  array (
  ),
))
===END===

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:03 PM
Is wordpress also running in Docker? If so, “localhost” within that Docker container refers to the wordpress container.

You want to use a special hostname to get the wordpress container to be able to connect to the Typesense container: https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container/43541732#43541732
john
Photo of md5-8580135584bd6fa853df7106a84c1fe2
john
03:21 PM
yes. Thank you for the pointer