From 96a69a94baaa0f495f63299e694bcfb1776cbb2a Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Mon, 26 Feb 2024 13:17:17 -0500 Subject: [PATCH] Updated entrypoint to automatically run dev environment migrations --- Dockerfile | 2 +- entrypoints/dev.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 entrypoints/dev.sh diff --git a/Dockerfile b/Dockerfile index a1df49e..5f135e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,4 @@ VOLUME /usr/src/colossus/vendor/ EXPOSE 8080 # Run the app -CMD [ "php", "-S", "0.0.0.0:8080", "-t", "public/", "public/index.php" ] +CMD [ "bash", "entrypoints/dev.sh" ] diff --git a/entrypoints/dev.sh b/entrypoints/dev.sh new file mode 100644 index 0000000..ce15360 --- /dev/null +++ b/entrypoints/dev.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# run database migrations before starting +vendor/bin/phinx migrate -e development + +# run the app through the PHP built-in dev server +php -S 0.0.0.0:8080 -t public/ public/index.php