[Fixed] Docker compose recreating containers for no reason

I can stop and rm the containers, but they recreate themselves in 5 seconds. I can just stop, but they restart immediately. they are blocking the 443 80 ports. I can’t docker rmi the images (see below). I’m a little desperate now because I can’t format my VPS i’d lose a ton of work.

I personally don’t remember running any dokploy or traefik compose files. none of my 2 currently running compose files use it or contain dokploy or traefik inside. i have no idea where or how it is auto recreating.

root@srv556089:~/evolution-api# docker stop 8d9c374ec6d0 64bf5e3d9c04 6be5eedb611c 9203b8b32f7f && docker rm 8d9c374ec6d0 64bf5e3d9c04 6be5eedb611c 9203b8b32f7f && docker rmi 18574e8a42ff 0c02a120479c
8d9c374ec6d0
64bf5e3d9c04
6be5eedb611c
9203b8b32f7f
8d9c374ec6d0
64bf5e3d9c04
6be5eedb611c
9203b8b32f7f
Error response from daemon: conflict: unable to delete 18574e8a42ff (cannot be forced) - image is being used by running container aefcfc3962d8
Error response from daemon: conflict: unable to delete 0c02a120479c (must be forced) - image is being used by stopped container 6b77dd2e1161
root@srv556089:~/evolution-api# docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED          STATUS                  PORTS                                                                      NAMES
241fba1f2346   traefik:v3.1.2                        "/entrypoint.sh trae…"   17 seconds ago   Up 12 seconds           0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   dokploy-traefik.1.lkggn04yzbeizkmd70r8x13qb
99691b6a6aca   redis:7                               "docker-entrypoint.s…"   26 seconds ago   Up 22 seconds           6379/tcp                                                                   dokploy-redis.1.1lfq5srssgh51nvunqzp1qzsk
9c927f37bac4   postgres:16                           "docker-entrypoint.s…"   26 seconds ago   Up 22 seconds           5432/tcp                                                                   dokploy-postgres.1.pa620dmoc0n5qzeo0wx7ezvex
aefcfc3962d8   dokploy/dokploy:latest                "docker-entrypoint.s…"   28 seconds ago   Up 22 seconds           0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                  dokploy.1.dvppji2c4i6uldcjch1lv2bsw

full containers list if relevant:

root@srv556089:~# docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED          STATUS                  PORTS                                                                      NAMES
241fba1f2346   traefik:v3.1.2                        "/entrypoint.sh trae…"   6 minutes ago    Up 6 minutes            0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   dokploy-traefik.1.lkggn04yzbeizkmd70r8x13qb
99691b6a6aca   redis:7                               "docker-entrypoint.s…"   6 minutes ago    Up 6 minutes            6379/tcp                                                                   dokploy-redis.1.1lfq5srssgh51nvunqzp1qzsk
9c927f37bac4   postgres:16                           "docker-entrypoint.s…"   6 minutes ago    Up 6 minutes            5432/tcp                                                                   dokploy-postgres.1.pa620dmoc0n5qzeo0wx7ezvex
aefcfc3962d8   dokploy/dokploy:latest                "docker-entrypoint.s…"   6 minutes ago    Up 6 minutes            0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                  dokploy.1.dvppji2c4i6uldcjch1lv2bsw
d0daf10fd77a   baptistearno/typebot-builder:latest   "/bin/sh -c ./${SCOP…"   47 minutes ago   Up 47 minutes           0.0.0.0:8090->3000/tcp, [::]:8090->3000/tcp                                typebot-typebot-builder-1
dfa2b0c1656d   baptistearno/typebot-viewer:latest    "/bin/sh -c ./${SCOP…"   47 minutes ago   Up 47 minutes           0.0.0.0:8091->3000/tcp, [::]:8091->3000/tcp                                typebot-typebot-viewer-1
d9758ef5a4cd   atendai/evolution-api:v2.1.1          "/bin/bash -c '. ./D…"   2 hours ago      Up 2 hours              0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                  evolution_api
456209abc252   f467189b71f3                          "docker-entrypoint.s…"   28 hours ago     Up 28 hours (healthy)   5432/tcp                                                                   typebot-typebot-db-1
7b9a62da9af0   postgres:15                           "docker-entrypoint.s…"   6 days ago       Up 6 days               0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                  postgres
6c96fd5d66c6   redis:latest                          "docker-entrypoint.s…"   6 days ago       Up 6 days               0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                  redis

edit:

apparently this comes from a swarm (it says providerName=swarm), I don’t use anything related to swarm atm

 container: traefik:v3.1.2
root@srv556089:~/evolution-api# docker logs 241fba1f2346
2025-02-10T08:40:30Z ERR error="service \"dokploy-traefik\" error: port is missing" container=dokploy-traefik-lkggn04yzbeizkmd70r8x13qb providerName=swarm

edit 2: fixed by leaving swarm I must have created accidentally in the past.

root@srv556089:~/evolution-api# docker swarm leave
Error response from daemon: You are attempting to leave the swarm on a node that is participating as a manager. Removing the last manager erases all current state of the swarm. Use `--force` to ignore this message.
root@srv556089:~/evolution-api# docker swarm leave --force
Node left the swarm.

You had a swarm stack called dokploy deployed. The names of the service tasks (~the created swarm service container) match <stack name>.<service name>.<task slot>.<task id>. Of course, the swarm scheduler will reconcile the current state and do whatever is necessary to reach the desired state.

You could have just execute docker stack rm dokploy to get rid of the swarm stack.

You also seem to have a compose project deployed, its container match <project name>-<service name>-<replica number>.

1 Like