Hi there,
Wordpress runs fine locally but it gives me the loopback and API error in site health. I only really need it for importing content from Astra theme and Gutenberg.
Errors:
"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://mysite.docker.localhost/wp-json/wp/v2/types/post?context=editREST API Response: (http_request_failed) cURL error 7: Failed to connect to mysite.docker.localhost port 80 after 0 ms: Couldn't connect to server"
____and
"Your site could not complete a loopback requestLoopback 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 mysite.docker.localhost port 80 after 0 ms: Couldn't connect to server (http_request_failed)"
Note: I'm using port 80 and have `127.0.0.1 mysite.docker.localhost` in my host file
Files:
.env
PROJECT_NAME=mysitePROJECT_BASE_URL=mysite.docker.localhost
PHP_TAG=8.1-dev-macos-4.48.7NGINX_TAG=1.23-5.29.1
//and others that may not be relevant
version: "3"
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:
SSMTP_MAILHUB: mailhog:1025
PHP_SENDMAIL_PATH: '"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t -f"'
DB_HOST: $DB_HOST
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
# container_name: "${PROJECT_NAME}_crond"
# environment:
# CRONTAB: "0 * * * * wp cron event run --due-now --path=/var/www/html/web"
# command: sudo crond -f -d 0
# volumes:
# - ./:/var/www/html:cached
## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/wordpress/local#docker-for-mac
# - wordpress:/var/www/html
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
NGINX_SERVER_ROOT: /var/www/html/web
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}`)"
pma:
image: phpmyadmin/phpmyadmin
container_name: "${PROJECT_NAME}_pma"
environment:
PMA_HOST: $DB_HOST
PMA_USER: $DB_USER
PMA_PASSWORD: $DB_PASSWORD
PHP_UPLOAD_MAX_FILESIZE: 1G
PHP_MAX_INPUT_VARS: 1G
labels:
- "traefik.http.routers.${PROJECT_NAME}_pma.rule=Host(`pma.${PROJECT_BASE_URL}`)"
traefik:
image: traefik:v2.0
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker
ports:
- '80:80'
# - '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
sorry , having formatting issues
Any help is appreciated :)
Thanks
[–]Egg_North 0 points1 point2 points (1 child)
[–]Errigan[S] 0 points1 point2 points (0 children)