diff --git a/docker/migration/Dockerfile b/docker/migration/Dockerfile index 162d5039c..190c1b389 100644 --- a/docker/migration/Dockerfile +++ b/docker/migration/Dockerfile @@ -37,4 +37,5 @@ RUN git clone https://github.com/vishnubob/wait-for-it.git ADD docker/migration/start.sh / RUN chmod +x /start.sh -CMD ["/start.sh"] \ No newline at end of file +# Once we listen the mysql port run the migration task. +CMD ./wait-for-it/wait-for-it.sh mysql:3306 -- sh -c "node ./build/commands.js system:migrate:latest && node ./build/commands.js tenants:migrate:latest" diff --git a/docker/migration/start.sh b/docker/migration/start.sh deleted file mode 100644 index 5fa9f0c28..000000000 --- a/docker/migration/start.sh +++ /dev/null @@ -1,5 +0,0 @@ -# Migrate the master system database. -./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js system:migrate:latest - -# Migrate all tenants. -./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js tenants:migrate:latest \ No newline at end of file