diff --git a/docker-compose.yml b/docker-compose.http.yml similarity index 100% rename from docker-compose.yml rename to docker-compose.http.yml diff --git a/docker-compose.https.yml b/docker-compose.https.yml index e525336..caa46aa 100644 --- a/docker-compose.https.yml +++ b/docker-compose.https.yml @@ -54,6 +54,7 @@ services: restart: unless-stopped environment: + APP_ENV: prod DATABASE_URL: mysql://odc:@db-odc:3306/odc OAUTH_KEYCLOAK_CLIENT_ID: opendatenschutzcenter OAUTH_KEYCLOAK_CLIENT_SECRET: diff --git a/setup.sh b/setup.sh index 3d56837..c8f9047 100644 --- a/setup.sh +++ b/setup.sh @@ -18,11 +18,6 @@ else echo "ODC_DB_PW=$ODC_DB_PW" >> $FILE source $FILE fi - ENVIRONMENT=${ENVIRONMENT:=prod} - read -p "Enter the environment dev/prod[$ENVIRONMENT]: " input - ENVIRONMENT=${input:=$ENVIRONMENT} - sed -i '/APP_ENV/d' $FILE - echo "APP_ENV=$ENVIRONMENT" >> $FILE HTTP_METHOD=${HTTP_METHOD:=http} read -p "Enter http/https for testing on local environment ALWAYS use http [$HTTP_METHOD]: " input @@ -57,10 +52,16 @@ echo ------------------------------------------------------------ echo ----------------- Build Docker Compose File ---------------- echo ------------------------------------------------------------ +cp docker-compose.$HTTP_METHOD.yml docker-compose.yml + sed -i "s||$KEYCLOAK_ADMIN_PW|g" docker-compose.yml sed -i "s||$KEYCLOAK_PW|g" docker-compose.yml sed -i "s||$OAUTH_KEYCLOAK_CLIENT_ID|g" docker-compose.yml sed -i "s||$PUBLIC_URL|g" docker-compose.yml sed -i "s||$HTTP_METHOD|g" docker-compose.yml sed -i "s||$ODC_DB_PW|g" docker-compose.yml -sed -i "s||$HOST_IP|g" docker-compose.yml \ No newline at end of file +sed -i "s||$HOST_IP|g" docker-compose.yml + +echo ------------------------------------------------------------ +echo ----------------- Select and Start Docker Compose ---------- +echo ------------------------------------------------------------