full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

You need to create a swarm-scoped network before the stack is deployed

Open teebu opened this issue 5 years ago • 4 comments

After building and running deploy, I'm getting this error.

Error:

network "traefik-public" is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed

docker network ls

2e1b7e59a2e3        fast-api-test-proj_default          bridge              local
ce37fdaa9fcd        fast-api-test-proj_traefik-public   bridge              local

I assume this network name should be traefik-public and not prefixed with the project name, that was created automatically during some step?

Do I have to manually create the network?

docker network create --driver=overlay traefik-public

What are the proper steps to get a deploy?

teebu avatar Jun 25 '20 21:06 teebu

I managed to create the stack, created that network, but I'm unable to connect on local machine. It works with docker-compose up but not with the swarm stack.

Running on Windows WSL2, docker for windows with swarm enabled v2.3.2.

DOMAIN=fast-api-test-proj.com TRAEFIK_TAG=fast-api-test-proj.com STACK_NAME=fast-api-test-proj-com TAG=prod bash ./scripts/deploy.sh

I tried

DOMAIN=localhost TRAEFIK_TAG=fast-api-test-proj.com STACK_NAME=fast-api-test-proj-com TAG=prod bash ./scripts/deploy.sh

http://localhost:8090/

Can someone point me to proper steps setting a local swarm going?

teebu avatar Jun 26 '20 21:06 teebu

I had the same error and it was because there was not network named traefik-public running yet. Take a look at this and the explanation of how to set up Traefik there. It should get you up to speed. And of course Issue #240 clarifies a whole lot about actually needing two (!) running Traefik containers.

teschmitt avatar Sep 28 '20 20:09 teschmitt

run the following command network create -d overlay traefik-public

HT-Moh avatar Jun 04 '21 16:06 HT-Moh

Please use the right comand: docker network create -d overlay your-network-name

ArtursTrubacs avatar Jun 03 '22 11:06 ArtursTrubacs