question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deployment using docker-machine

See original GitHub issue

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:

  1. I used docker-machine to create a VPS on azure with docker installed.
  2. I set the domain name of the machine to “fastapitest” such that the DNS of the machine is fastapitest.uksouth.cloudapp.azure.com
  3. I used cookiecutter to set up a project based on the “full-stack-fastapi-postgresql” template, I used the DNS name of the VPS set in (2) above for the “DOMAIN” variable during configuration and used docker-compose to check everything worked locally - wich it did
  4. I used docker-machine env so that I can run docker commands directly on the machine
  5. I used docker swarm init to initialise a single machine cluster
  6. I ran the “build” script as described in the README file: TAG=prod FRONTEND_ENV=production bash ./scripts/build.sh
  7. I rang the “deploy” script as described in the README file:
DOMAIN=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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dmontagucommented, Aug 18, 2019

@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
1reaction
dmontagucommented, Aug 18, 2019
  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.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Compose in production - Docker Documentation
You can use Compose to deploy an app to a remote Docker host by setting the DOCKER_HOST , DOCKER_TLS_VERIFY , and DOCKER_CERT_PATH environment...
Read more >
Deploy your app - Docker Documentation
Deploy your app. Build images · Run your image as a container · Use containers for development · Run tests · Configure CI/CD...
Read more >
Get started with Docker Machine and a local VM
create a new (or start an existing) Docker virtual machine; switch your environment to your new VM; use the docker client to create,...
Read more >
A beginner's guide to deploying a Docker application to ...
Docker Compose is a tool for managing multi-container applications such as a web application we discussed above. Each container acts as a ...
Read more >
How to Get Started with Docker Machine - UpCloud
After the newly provisioned host replies that it is ready, you can employ the docker run command to deploy containers, granted that you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found