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 ports, it always conflict the domain of the previous instance into the new one. But if I specify the ports, the domain: myexample.com points to 8083 always show Bad gateway error message.
services:
wordpress:
image: wordpress:6.6
ports:
- 8083:80
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: null
db_data: null
networks:
dokploy-network:
external: true
services:
wordpress:
image: wordpress:6.6
ports:
- 8083:80
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: null
db_data: null
networks:
dokploy-network:
external: true
8 Replies
Siumauricio
Siumauricio9mo ago
Remove the ports section from Wordpress service And then you can create as many Wordpress instances you want
Sang Dang
Sang DangOP9mo ago
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.
Siumauricio
Siumauricio9mo ago
I will try
yureckey
yureckey9mo ago
Yeah, I cannot create more than one instance of Wordpress (from the App template)
Siumauricio
Siumauricio9mo ago
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
yureckey
yureckey9mo ago
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
Siumauricio
Siumauricio9mo ago
yep the thing is you need to change the WORDPRESS_DB_HOST: db to WORDPRESS_DB_HOST: db-${COMPOSE_PREFIX}
yureckey
yureckey9mo ago
ah! will try yup, worked, thank you!

Did you find this page helpful?