Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Issues: Site Health Status #83

Open
3xploiton3 opened this issue Feb 4, 2024 · 6 comments
Open

Critical Issues: Site Health Status #83

3xploiton3 opened this issue Feb 4, 2024 · 6 comments

Comments

@3xploiton3
Copy link

Codebase

Built-in vanilla WordPress

Host OS

Arch _x86_64

Docker info output

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.3-desktop.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.22
    Path:     /usr/lib/docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /usr/lib/docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     /usr/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.3.0
    Path:     /usr/lib/docker/cli-plugins/docker-scout

Server:
 Containers: 20
  Running: 6
  Paused: 0
  Stopped: 14
 Images: 21
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7c3aca7a610df76212171d200ca3811ff6096eb8.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.7.3-zen1-1-zen
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.51GiB
 Name: arch
 ID: 70044d2f-49f7-43ea-adf4-15c74e2aa618
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker compose file

Make sure you remove all commented services.

services:
  mariadb:
    image: wodby/mariadb:$MARIADB_TAG
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 30s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD

  php:
    image: wodby/wordpress-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:

      PHP_MAIL_MIXED_LF_AND_CRLF: On
      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'

      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      PHP_FPM_USER: wodby
      PHP_FPM_GROUP: wodby

    volumes:
    - ./:/var/www/html:cached

  crond:
    image: wodby/wordpress-php:$PHP_TAG
    init: true
    container_name: "${PROJECT_NAME}_crond"
    environment:
      CRONTAB: "0 * * * * wp cron event run --due-now --path=/var/www/html"
    command: sudo crond -f -d 0
    volumes:
    - ./:/var/www/html:cached

  nginx:
    image: wodby/nginx:$NGINX_TAG
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
    - php
    environment:
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_VHOST_PRESET: wordpress
    volumes:
    - ./:/var/www/html:cached
    labels:
    - "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"

  mailhog:
    image: mailhog/mailhog
    container_name: "${PROJECT_NAME}_mailhog"
    labels:
    - "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
    - "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"

  traefik:
    image: traefik:v2.0
    container_name: "${PROJECT_NAME}_traefik"
    command: --api.insecure=true --providers.docker
    ports:
    - '8000:80'
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock

Logs output

image

issues 1

The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.

When testing the REST API, an error was encountered:

REST API Endpoint: http://wp.docker.localhost:8000/index.php?rest_route=%2Fwp%2Fv2%2Ftypes%2Fpost&context=edit
REST API Response: (http_request_failed) cURL error 7: Failed to connect to wp.docker.localhost port 8000 after 0 ms: Couldn't connect to server

issues 2

Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.
Error: cURL error 7: Failed to connect to wp.docker.localhost port 8000 after 0 ms: Couldn't connect to server (http_request_failed)
@csandanov
Copy link
Member

did you add wp.docker.localhost to your /etc/hosts? also make sure traefik is the only one who's listening to port 8000

@3xploiton3
Copy link
Author

3xploiton3 commented Mar 5, 2024

yes,

image

is this the right way to see listen port 8000?
image

OS: arch linux x86_64

@csandanov
Copy link
Member

Could you please clarify what happens after installation (does installation even happen?), where do you see this critical issues page? What's your images tags (.env file).

@3xploiton3
Copy link
Author

Wordpress Site, Tools > Site Health

image

any configuration based on latest repo https://github.com/wodby/docker4wordpress, without any changes

@csandanov
Copy link
Member

Oh I see, this won't work with localhost domain, containers can't access your local domains by default, they are defined on your host machine, containers are isolated. You need to use a real domain with a proxy for local setup or use a some workaround with docker domain (docker.host.internal?)

@3xploiton3
Copy link
Author

could you add this feature to repo?

so docker4wordpress fully support for local environment,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants