this post was submitted on 23 Jan 2024
8 points (100.0% liked)

Docker

1100 readers
2 users here now

founded 1 year ago
MODERATORS
 

I just installed Immich and while all my other containers have just required me to add to them to existing yaml, Immich requires its own yaml. That's fine I guess, but for the library, I wanna host it on my NAS and so I made the volume in my main Docker-Compose.yaml, the Immich yaml was all like, "what you talking about Willis?" because in my Immich environment I tried to point to something created in my main yaml. I thought I could work around this by adding an empty volume declaration, but now I can't find my uploads ๐Ÿ˜‚ any idea on the correct methodology/workaround?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] jsalvador@programming.dev 4 points 9 months ago

Answer has been solved but, just in case someone is curious about it: yes, is possible to extend a docker-compose.yaml file with another.

From Docker's docs: https://docs.docker.com/compose/multiple-compose-files/extends/

You can have a common-services.yml file (or whatever name you want to give to it) with a service defined inside, like this:

services:
  webapp:
    build: .
    ports:
      - "8000:8000"
    volumes:
      - "/data"

And then, in your docker-compose.yaml file just extend it with more specific things.

services:
  web:
    extends:
      file: common-services.yml
      service: webapp