diff --git a/packages/create-plugin/templates/common/.config/Dockerfile b/packages/create-plugin/templates/common/.config/Dockerfile index 77d64e74cd..9b1e370ada 100644 --- a/packages/create-plugin/templates/common/.config/Dockerfile +++ b/packages/create-plugin/templates/common/.config/Dockerfile @@ -19,8 +19,7 @@ ENV DEV "${development}" ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" ENV GF_AUTH_ANONYMOUS_ENABLED "${anonymous_auth_enabled}" ENV GF_AUTH_BASIC_ENABLED "false" -# Set development mode so plugins can be loaded without the need to sign -ENV GF_DEFAULT_APP_MODE "development" +# GF_DEFAULT_APP_MODE is set dynamically in entrypoint.sh based on the DEV build arg LABEL maintainer="Grafana Labs " diff --git a/packages/create-plugin/templates/common/.config/entrypoint.sh b/packages/create-plugin/templates/common/.config/entrypoint.sh index 00c69f246f..c92c9eeff7 100644 --- a/packages/create-plugin/templates/common/.config/entrypoint.sh +++ b/packages/create-plugin/templates/common/.config/entrypoint.sh @@ -1,5 +1,10 @@ #!/bin/sh +# Default to development mode; switch to production when DEV=false +if [ "${DEV}" = "false" ]; then + export GF_DEFAULT_APP_MODE="production" +fi + if [ "${DEV}" = "false" ]; then echo "Starting test mode" exec /run.sh