Hi,
I am deployment a website with the stack SWAG, Wordpress and MariaDB in a Raspberry Pi 4. I configurated all an it works well when I am access to the website with local ip but if I use the domain to connect with Wordpress, it doesn't connect with the data base. My docker compose is this:
version: "3.9"
services:
# https://hub.docker.com/r/linuxserver/swag
swag:
depends_on:
- wordpress
image: lscr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Madrid
- URL=${SWAG_URL}
- VALIDATION=http
- SUBDOMAINS=${SWAG_SUBDOMAINS} #optional
- ONLY_SUBDOMAINS=false #optional
- STAGING=false #optional
volumes:
- ${SWAG_CONFIG}:/config
- ${WORDPRESS_DIR}:/config/www
ports:
- 443:443
- 80:80 #optional
restart: unless-stopped
# https://hub.docker.com/_/mariadb
db:
image: mariadb:latest
container_name: db
environment:
MARIADB_ROOT_PASSWORD: ${DB_MARIADB_ROOT_PASSWORD}
MARIADB_DATABASE: ${DB_MARIADB_DATABASE}
MARIADB_USER: ${DB_MARIADB_USER}
MARIADB_PASSWORD: ${DB_MARIADB_PASSWORD}
volumes:
- ${DB_MARIADB}:/var/lib/mariadb
- ${DB_MYSQL}:/var/lib/mysql
restart: unless-stopped
# https://hub.docker.com/_/wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
container_name: wordpress
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=${DB_MARIADB_USER}
- WORDPRESS_DB_PASSWORD=${DB_MARIADB_PASSWORD}
- WORDPRESS_DB_NAME=${DB_MARIADB_DATABASE}
- VIRTUAL_PORT=80
volumes:
- ${WORDPRESS_DIR}:/var/www/html
ports:
- 8080:80
restart: unless-stopped
adminer:
image: adminer
container_name: adminer
restart: always
ports:
- 9333:8080
It is not a problem of external access to my Wordpress instance since the database error appears and before installing Wordpress the SWAG static page appears correctly.
Access from local network

Access with domain

Do you know what could be happening?
Thanks!
Hi,
I am deployment a website with the stack SWAG, Wordpress and MariaDB in a Raspberry Pi 4. I configurated all an it works well when I am access to the website with local ip but if I use the domain to connect with Wordpress, it doesn't connect with the data base. My docker compose is this:
It is not a problem of external access to my Wordpress instance since the database error appears and before installing Wordpress the SWAG static page appears correctly.
Access from local network

Access with domain

Do you know what could be happening?
Thanks!