Imported template is broken in WordPress (Container), the rest api encountered an error, your site could not complete a loopback request, curl error 28: failed to connect to localhost port 8080: http_request_failed

Tools:

  • fedora 36
  • podman v. 4.1.0
  • podman-compose v. 1.0.3 (fedora repository)
  • Astra Theme, template: Organic Store

I have been working in a initializer.yaml file to work with wordpress. I follow this initializer.yaml example .

version: "3.8"
services: 
  web:
    image: wordpress
    restart: always
    volumes:
      - wordpress:/var/www/html
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: magazine
      WORDPRESS_DB_NAME: magazine
      WORDPRESS_DB_PASSWORD: 1maGazine!
      WORDPRESS_TABLE_PREFIX: cz
      WORDPRESS_DEBUG: 0
    depends_on:
      - db
    networks:
      - wpnet
  db:
    image: mariadb:10.5
    restart: always
    ports:
      - 6603:3306

    volumes:
      - wpdbvol:/var/lib/mysql

    environment:
      MYSQL_DATABASE: magazine
      MYSQL_USER: magazine
      MYSQL_PASSWORD: 1maGazine!
      MYSQL_ROOT_PASSWORD: 1maGazine!
    networks:
      - wpnet
volumes:
  wordpress: {}
  wpdbvol: {}

networks:
  wpnet: {}

It works fine except when install Astra theme and the template Organic Store.

The template is broken using Gutemberg as the Block Editor.


There is no images there.

Related issue : https://wordpress.org/support/topic/imported-template-is-broken-with-gutenberg-as-the-page-builder/

Site Health

Command to run the containers

  ~/Documents/phclone                                                                                                                                                     
❯ ll
total 4.0K
-rw-r--r--. 1 chris chris 968 May 20 10:37 initializer.yaml

❯ podman-compose -f initializer.yaml up -d

Video, screencast
link

Questions
What do you think is the problem?
Is a container networks problem?
Is there a problem in the initializer.yaml file structure?

cURL error 28: failed to connect to localhost port 8080: http_request_failed
initializer.yaml

...
volumes:
      - wordpress:/var/www/html
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
...

The problems means about mapping, the wordpress container is using the port 8080 instead 80.
Meanwhile an alternative is use rootfull podman and use port 80 instead of 8080 for host in the port mapping.

...
volumes:
      - wordpress:/var/www/html
    ports:
      - 80:80
    environment:
      WORDPRESS_DB_HOST: db
...
sudo su
podman-compose -f initializer.yaml up -d

screencast