Skip to content

Commit

Permalink
Run database migrations at container startup
Browse files Browse the repository at this point in the history
  • Loading branch information
BraeWebb committed Mar 30, 2022
1 parent 7eb9daf commit 09f3dbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ WORKDIR /app

RUN composer install

CMD ["php", "artisan", "serve", "--host=0.0.0.0"]
CMD ["./docker-init.sh"]

5 changes: 5 additions & 0 deletions backend/docker-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

sleep 10
php artisan migrate:refresh
php artisan serve --host=0.0.0.0

0 comments on commit 09f3dbc

Please sign in to comment.