I'm having trouble getting deployment to work for the out-of-the-box "full-stack-fastapi-postgresql" template using the instructions on the README file as well as what I've read on DockerSwarm.rocks. Here are the steps I've taken:
fastapitest.uksouth.cloudapp.azure.comdocker-machine env so that I can run docker commands directly on the machinedocker swarm init to initialise a single machine clusterTAG=prod FRONTEND_ENV=production bash ./scripts/build.shDOMAIN=fastapitest.uksouth.cloudapp.azure.com \
TRAEFIK_TAG=fastapitest.uksouth.cloudapp.azure.com \
STACK_NAME=fastapitest \
TAG=prod \
bash ./scripts/deploy.sh
I get the following output:
WARNING: Some services (backend, db, flower, frontend, pgadmin, proxy) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
---
+++
Label: fastapitestTAG=prod.app-db-data
With value: true
Assigned to node in hostname: fastapi-test
With node ID: s885d1okylneu7043t9af6q2i
---
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
Do I need to create a network with that name on my VPS? Azure automatically sets up a Network interface with a Virtual Network/Subnet called: docker-machine-vnet/docker-machine, is this releated?
@DrNickMartin
I'm not sure exactly what the problem is, but for what it's worth this looks to me more likely to be a docker swarm configuration issue than a VPS issue.
If I had to guess, I think maybe you didn't create the traefik-public network?
See here -- search for the code block:
docker network create --driver=overlay traefik-public
@dmontagu
Thanks - that worked. The stack deploys on the VPS now and all the services appear to be up and running. The only issue is that if I navigate/curl to the domain (or directly to IP address) I get an ERR_CONNECTION_REFUSED. Port 80 is open to all incoming TCP traffic.
I guess I'm still not setting up Traefik correctly with the azure VPS, perhaps it doesn't like the Azure generated domain I'm using? The log from the proxy service (traefik) is just repeated outputting:
time="2019-08-18T22:56:19Z" level=info msg="Skipping same configuration for provider docker"
1) Make sure that you can curl the server from the same machine
2) Make sure there is nothing funny happening with route prefixes
3) See if you can access a server running on the same machine that should definitely work and not be broken due to traefik configuration (something like a jupyter notebook, or just run a uvicorn server outside of docker). That should help you determine whether it is a traefik error or a DNS/other error. If you aren't seeing anything in the traefik logs indicating connections are being rejected, the problem may exist somewhere entirely outside of docker.
Thanks for your help @dmontagu ! :rocket: :cake: :bowing_man:
Thanks @DrNickMartin for reporting back and closing the issue :tada:
@n1ckdm What did you do to fix the ERR_CONNECTION_REFUSED? I have the same error?
Nevermind. I think I finally got it.
I had to do a bunch of stuff. Probably more than necessary since I don't know what I am doing. I did the following and it seems to work with docker stack deploy
docker-compose.deploy.ports.yml"traefik.http.services.flower.loadbalancer.server.port=5555""--providers.docker.swarmMode=true" to docker-compose.deploy.command.yml