How to deploy docker stack/swarm application
I've switched from docker compose to docker stack and after making changes to my docker-compose.yaml I've successfully deployed using docker stack/swarm.
However I am unable to access any of my applications even after setting domains and redeploying. I also can't see any containers running.
I feel like this is a simple issue but I don't know what to do since the docs are very somewhat basic. I am still confused on how to deploy using docker stack. I've built and pushed my images to docker hub in private repos.
I've attached my yaml file and build logs
4 Replies
Check Traefik logs
I feel like theres some crucial thing I am missing. Because I do not see any of the containers for the defined services in the Logs, Monitoring tabs or on the Docker Containers page. I only see my 2 databases (redis + mysql) containers running there.
Have I done the right steps? Isn't there a need for credentials or anything since the images are hosted on a private registry?
Although it says deployment was successful it seemed too easy 😩
So making the images on docker hub public resolves my deployment and I can access the applications. But I still don't know how we can use private image repositories when deploying with docker stack
I may have figured it out. I took these steps and it seems to work now:
- Add a container/docker registry account to dokploy
- append '--with-registr-auth' to the default command used to start the docker compose stack (can be found in the 'Advanced' tab)
stack deploy -c ./docker-compose.ya<...> --with-registry-auth --prune
I say may because I tried a bunch of other stuff when I SSH'd into the server running dokploy also. I did try to undo as much of them as I could so I could isolate and confirm this was the solution thoughI think I’m running into a similar issues transitioning from pertained (swarm) to dokploy. Will try your fix and report back if that get’s it working
Seems to fix it. But I think dokploys swarm support isn't quite there yet. We'll visit it in a couple of months to see how swarm support might have improved.
You may need to do some slight manual configuration to the
traefik.yml
file to have Swarm working