In my docker-compose file I have a frontend, backend and Database. If I start docker-compose up the backend starts before the Database are finished, so they crashed because the backend can not connect to any database.
server_backend:
build:
context: server_backend
ports:
- 8080:8080
links:
- database
depends_on:
- database
restart: unless-stopped
database:
image: mysql
ports:
- 3306:3306
I use "depends_on:" but it do not help.
How can I say, that the backend should created after the database?