I have mounted two identical docker on two ubuntu vps with docker-compose.
The concern is that the first one works well, and the pilces dialogue between it, the second one not.
What I see is that the ip set by default in 1 / is 172.X.X.X and the one set in 2 / is 192.X.X.X.
I am on virgin vps, no particular configuration file … but I do not see how this is possible.
Here is the docker-compose
version: '2.4'
services:
redis:
image: redis:alpine
db:
image: mariadb:10.5
working_dir: /application
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-format=Barracuda, --innodb-large-prefix=1, --innodb-file-per-table=1]
volumes:
- pimcore-demo-database:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=ROOT
- MYSQL_DATABASE=pimcore
- MYSQL_USER=pimcore
- MYSQL_PASSWORD=pimcore
php:
image: pimcore/pimcore:PHP8.0-apache
volumes:
- .:/var/www/html:cached
ports:
- 80:80
- 443:443
environment:
- APACHE_DOCUMENT_ROOT=/var/www/html/public
php-debug:
image: pimcore/pimcore:PHP8.0-apache-debug
volumes:
- .:/var/www/html:cached
ports:
- 88:80
environment:
- PHP_IDE_CONFIG="serverName=localhost"
- APACHE_DOCUMENT_ROOT=/var/www/html/public
volumes:
pimcore-demo-database:
thank you in advance
2
Answers
Ok solution :
Try to add networking config inside your compose yml to use specific IPs, like following:
more infos on https://docs.docker.com/compose/networking/#use-a-pre-existing-network