Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: container_name prevents replication. #2131

Open
chrisbecke opened this issue May 3, 2024 · 1 comment
Open

[Bug]: container_name prevents replication. #2131

chrisbecke opened this issue May 3, 2024 · 1 comment
Assignees
Labels

Comments

@chrisbecke
Copy link

Description

It is not possible to deploy Docker compose files with "replicas:" other than 1.

Minimal Reproduction (if possible, example repository)

Create a Docker Compose resource and attach the following compose.yaml

services:
  my:
    image: 'nginx:latest'
    deploy:
      replicas: 3

Exception or Error

Saved configuration files to /data/coolify/services/iokgo8w.
Creating Docker network.
Starting service.
Pulling images.
services.deploy.replicas: can't set container_name and my as container name must be unique: invalid compose project

Version

v4.0.0-beta.270

@Aniketh999
Copy link

To resolve this issue, you need to ensure that each replica has a unique container name. You can achieve this by using the container_name option in your service configuration. Here's an example of how you can modify your Docker Compose file:

services: my: image: 'nginx:latest' deploy: replicas: 3 container_name: my_container_1 deploy: replicas: 3 container_name: my_container_2 deploy: replicas: 3 container_name: my_container_3

@andrasbacsai andrasbacsai self-assigned this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants