'Why wont this code take the database schema using flyway and migrate it to docker container database?

I have the following code to take an existing schema "config_data" and apply it to a docker container database "db":

here is my code, it all happens inside the docker-compose.yaml file:

  flyway:
    image: flyway/flyway
    network_mode: bridge
    restart: always
    command: -url=jdbc:mysql://localhost:3311/db -schemas=config_data -user=root -password=P@ssw0rd -connectRetries=60 migrate

    volumes:
      - ./flyway:/flyway/sql
    depends_on:
      - db
  db:
    image: mysql
    network_mode: bridge
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=P@ssw0rd
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    ports:
      - 3311:3306

My understanding is that flyway can copy the schema of one db "config_data" and apply that to a docker container db.

When I run docker-compose up I log into mysql workbench with those credentials, the problem is, it's a generic db with none of the tables/schema I need to have.

What is causing this and how can I fix it?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source