educative.io

Get an error using docker stack

I get this error in my localhost 5000:
MySQLdb._exceptions.OperationalError: (2005, "Unknown MySQL server host 'backenddb' (-2)")
I think, it is related to this code in app.py
app.config['MYSQL_HOST'] = 'backenddb'

(1) Does it really matter for this name? (can change to any name?)
(2) this error only happens when using docker stack deploy <compose.yml>), not if you do it step by step.


Course: Working with Containers: Docker & Docker Compose - Learn Interactively
Lesson: Automating Deployments Using Docker Stack - Working with Containers: Docker & Docker Compose

solved, I think we need to change it to database


Course: Working with Containers: Docker & Docker Compose - Learn Interactively
Lesson: Do It Yourself - Exercise - Working with Containers: Docker & Docker Compose