Deploying same compose config from two different computer

Hi,

I use docker compose to remote deploy services (image on private registry) to a server.

docker --host xxxx rcompose up -d 

with

docker-compose.yml

name: projet_x
service_a:
   image: myregistry/myimage:1.0.0
   volumes:
     - <path on remote computer>:<path in container>
    ....
service_b:
    ....

If I need to deploy the version 2.0.0 of the image from an other computer (by somebody else or because I change computer) so I should get the docker-compose.yml and do a
docker --host xxxx rcompose up -d
and docker should use the project name to retreive the service_a and update it, or did I miss something ?

A. Please format your code
```yml
code here
```

B. Is that / as the host mount path??

What is the rcompose command you’re using? At first I thought it was a typo, but you made it twice, so just verifying if you’re actually talking about compose and not some custom tool

As for your question, if you edit the compose file to change the image (or version), yes, up -d will recreate the container from the new image

Oup, thanks, done.

Yes I mount directories on the remote server to directories in the container.

The files does refer to only remote content and config, the only local file is the yml file.

Yes it’s typo, ADHD and copy/past does mix…in a bad way. With a pinch of dyslexia to make things smoother.

lol it’s ok, just wanted to make sure

The question (B) was about the path itself.
At first, the host path you posted looked like this:

volumes:
  - /:/container/path

So I asked, as you probably should not mount the root directory of your machine into the container

Oh no ! It was for

/something/something

Great, just wanted to make sure

So as for your question, if a service is up and its configuration (Including image) changes, the next docker compose up will recreate it effortlessly

Super easy for services using someimage:latest to just do

docker compose pull
docker compose up -d 

If I do it on the computer on which I initialy run the compose up, yes.

But if I copy the compose yml file to antoher computer It will not work (the link between the compose project and the container is lost).
As I understand the name: shool take care of the container identification (project name + service/container name).

Sorry, I missed that part, yes you probably need the COMPOSE_PROJECT_NAME (The name property) to be the same

I have not tried though, as I usually SSH into my machines and use the CLI there, but I’m curious to test it out

Silly me it was a docker desktop version difference between the 2 computer. Yhey have change their way to identify the containers between the two versions.
I thought I had updates the older one but it seems not.

So it works as intended, the name: attribute is working (locally and remotely) to identify the containers from the config.