So first things first, let’s rename database to immich-database, redis to immich-redis
Docker compose does this for you, so a service named database
becomes immich-database
if your compose project is named "immich" by placing it inside a folder by that name. You would have ended up with immich-immich-database
Same goes for your volumes.
most importantly, let’s give it a port that’s not the default postgres port that everyone wants to use. Easy right? Nope.
Since the postgres container is on that specific compose project network, the port is not shared and won't interfere with any other compose projects, so there's no need to change it away from the default. The main thing is each compose project is isolated by itself.
Also get rid of the ports:
map for the database, it's already part of the same compose network and does not need a port exposed to the outside.
so I went in and added the IP as the DB_URL to the .env
Don't use IPs to refer to docker containers as they change, instead use the container name so database
for example. (Just don't prefix it with the project name, so don't use immich-database
for example).
Essentially just undo your changes and it should all work as expected, and will be entirely isolated so won't interfere with any other containers or compose projects you run.
Correct yes, each compose project is isolated on its own network as well.