diff --git a/.devcontainer/devcontainer.env b/.devcontainer/devcontainer.env index 2288eb8..be96342 100644 --- a/.devcontainer/devcontainer.env +++ b/.devcontainer/devcontainer.env @@ -1,11 +1,7 @@ MYSQL_DATABASE=SilverStripe -MYSQL_ROOT_PASSWORD=root +SS_DATABASE_NAME=SilverStripe -SS_ENVIRONMENT_TYPE=dev -SS_BASE_URL=http://localhost - -SS_DATABASE_CLASS=MySQLPDODatabase -SS_DATABASE_SERVER=db - -SS_DEFAULT_ADMIN_USERNAME=root -SS_DEFAULT_ADMIN_PASSWORD=password \ No newline at end of file +MYSQL_USER=silverstripe +SS_DATABASE_USERNAME=silverstripe +MYSQL_PASSWORD=Sup3rS3cr3tP@ssw0rd +SS_DATABASE_PASSWORD=Sup3rS3cr3tP@ssw0rd diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 7cb5262..65f2cb9 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -4,6 +4,13 @@ services: silverstripe: image: manuth/silverstripe-dev env_file: devcontainer.env + environment: + - SS_ENVIRONMENT_TYPE=dev + - SS_BASE_URL=http://localhost:8080 + - SS_DATABASE_CLASS=MySQLPDODatabase + - SS_DATABASE_SERVER=db + - SS_DEFAULT_ADMIN_USERNAME=root + - SS_DEFAULT_ADMIN_PASSWORD=password ports: - 8080:80 - 3000:3000 @@ -15,5 +22,7 @@ services: db: image: mysql:5 env_file: devcontainer.env + environment: + - MYSQL_RANDOM_ROOT_PASSWORD=yes volumes: - ./mysql-data:/var/lib/mysql \ No newline at end of file diff --git a/test/website/public/index.php b/test/website/public/index.php index 9516aaf..5ee1af1 100644 --- a/test/website/public/index.php +++ b/test/website/public/index.php @@ -3,7 +3,6 @@ use SilverStripe\Control\HTTPApplication; use SilverStripe\Control\HTTPRequestBuilder; use SilverStripe\Core\CoreKernel; -use SilverStripe\Core\Environment; // Find autoload.php if (file_exists(__DIR__ . '/../vendor/autoload.php')) { @@ -16,21 +15,6 @@ if (file_exists(__DIR__ . '/../vendor/autoload.php')) { exit(1); } -if (Environment::getEnv("SS_DATABASE_USERNAME") === false) -{ - Environment::setEnv("SS_DATABASE_USERNAME", Environment::getEnv("MYSQL_USERNAME") ?: "root"); -} - -if (Environment::getEnv("SS_DATABASE_PASSWORD") === false) -{ - Environment::setEnv("SS_DATABASE_PASSWORD", Environment::getEnv("MYSQL_PASSWORD") ?: Environment::getEnv("MYSQL_ROOT_PASSWORD")); -} - -if (Environment::getEnv("SS_DATABASE_NAME") === false) -{ - Environment::setEnv("SS_DATABASE_NAME", Environment::getEnv("MYSQL_DATABASE")); -} - // Build request and detect flush $request = HTTPRequestBuilder::createFromEnvironment();