so, a typical problem, we would like to have dynamic environments so that we can minimize docker images and versions of our executables etc
which also applies when we use OneCode -language (such as Flutter, Cordova etc.) This repo is based on Flutter in use with docker to support for Q&A regards article / port at stackoverflow
Clone this repo, OR create you own Flutter starter app via Flutter Create and then copy/past from my lib/main.dart
git clone https://github.com/mklarsen/flutter4cicd.git
flutter clean
flutter pub get
flutter config --build-dir=build
flutter config --enable-web
flutter build web -t lib/main.dart
docker build . -t flutter4devops
docker run \
--env "BACKEND_APIURL=https://backendapi" \
-p 80:80 flutter4devops
So this is a work-around, it will work sices we build the WebApp with the variables, so they are static in the Docker images.
flutter build web -t lib/main.dart --dart-define BACKEND_APIURL=http://backendapi.com
docker build . -t flutter4devops
docker run \
-p 80:80 flutter4devops
flutter run --dart-define BACKEND_APIURL=http://backendapi.com