Wordpress template can not point new domain
Update: I was wrong. No matter how I modify the docker compose, the domain from other instance always mess with the new instance. T_T
I have installed one Wordpress instance, it works well, but whenever I add another Wordpress instance, if I do not specify the it always conflict the domain of the previous instance into the new one.
But if I specify the ports, the domain:
ports
,myexample.com
points to 8083
always show Bad gateway
error message.
8 Replies
Remove the ports section from Wordpress service
And then you can create as many Wordpress instances you want
Sorry, but I faced the issue without it, then I added it with the hope it might help me.
I can remove it but then it goes back to the original issue.
I will try
Yeah, I cannot create more than one instance of Wordpress (from the App template)
I’m aware of this issue, in docker compose we offer a function to randomize function
I need to change the templates to use this feature automatically
But you can use the randomize function and use it and it will work
I've tried. I've installed first Wordpress instance from the template, then second Wordpress from the Compose (with the same cofing) and used randomize for second instance. Still, my second instance link opens first one 😦
first:
version: "3.8"
services:
wordpress:
image: wordpress:6.6
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress_data:/var/www/html
db:
image: mysql:8.4
networks:
- dokploy-network
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_ROOT_PASSWORD: rootpass
volumes:
- db_data:/var/lib/mysql
volumes:
wordpress_data:
db_data:
second: version: '3.8' services: wordpress-b503c00f: image: wordpress:6.6 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb volumes: - wordpress_data-b503c00f:/var/www/html db-b503c00f: image: mysql:8.4 networks: - dokploy-network environment: MYSQL_DATABASE: exampledb MYSQL_USER: exampleuser MYSQL_PASSWORD: examplepass MYSQL_ROOT_PASSWORD: rootpass volumes: - db_data-b503c00f:/var/lib/mysql volumes: wordpress_data-b503c00f: null db_data-b503c00f: null
second: version: '3.8' services: wordpress-b503c00f: image: wordpress:6.6 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb volumes: - wordpress_data-b503c00f:/var/www/html db-b503c00f: image: mysql:8.4 networks: - dokploy-network environment: MYSQL_DATABASE: exampledb MYSQL_USER: exampleuser MYSQL_PASSWORD: examplepass MYSQL_ROOT_PASSWORD: rootpass volumes: - db_data-b503c00f:/var/lib/mysql volumes: wordpress_data-b503c00f: null db_data-b503c00f: null
yep the thing is you need to change the WORDPRESS_DB_HOST: db to WORDPRESS_DB_HOST: db-${COMPOSE_PREFIX}
ah! will try
yup, worked, thank you!