LondheShubham153 / two-tier-flask-app

117 stars 1.29k forks source link

database and table created in mysql automatically using docker compose command #38

Open satispat opened 6 months ago

satispat commented 6 months ago

Below are the changes made to this file: 1) Added the init file, so that mysql contianer will pick up the schema for database from the given file(message.sql) at container creation time in command option of mysql service. 2) Mount sql script(message.sql) into container using volume option of mysql service. 3) In the message.sql file , the creation and use of db is created so that when container is up and running at that time db and table are getting created automatically.