Commit 2fc6666c authored by Tobias Munk's avatar Tobias Munk

moved config to separate folder

parent 5435a0d8
FROM dmstr/php-yii2:7.1-fpm-3.1-alpine-nginx
FROM yiisoftware/yii2-php:7.2-apache
WORKDIR /app
......@@ -6,6 +6,7 @@ ADD composer.lock composer.json /app/
RUN composer install --prefer-dist --optimize-autoloader
ADD yii /app/
ADD ./config /app/config
ADD ./web /app/web/
ADD ./src /app/src/
RUN cp src/app.env-dist src/app.env
......
......@@ -3,19 +3,30 @@
"minimum-stability": "stable",
"require": {
"vlucas/phpdotenv": "2.*",
"yiisoft/yii2": "^2.0.8",
"yiisoft/yii2": "^2.0.13",
"yiisoft/yii2-bootstrap": "2.*",
"yiisoft/yii2-debug": "2.*",
"codemix/yii2-streamlog": "^1.0.0"
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
},
"asset-vcs-driver-options": {
"github-no-api": true
},
"asset-pattern-skip-version": "(-build|-patch)"
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"config": {
"fxp-asset": {
"enabled": false,
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
},
"vcs-driver-options": {
"github-no-api": true
},
"git-skip-update": "2 days",
"pattern-skip-version": "(-build|-patch)",
"optimize-with-installed-packages": false
}
}
}
This diff is collapsed.
......@@ -13,7 +13,7 @@
return [
'id' => 'app',
'language' => 'en',
'basePath' => dirname(__DIR__),
'basePath' => dirname(__DIR__).'/src',
'vendorPath' => '@app/../vendor',
'runtimePath' => '@app/../runtime',
// Bootstrapped modules are loaded in every request
......
......@@ -14,7 +14,7 @@ $version = is_file(__DIR__.'/../version') ? file_get_contents(__DIR__.'/../versi
defined('APP_VERSION') or define('APP_VERSION', $version);
// Load default settings via dotenv from file
$dotenv = new Dotenv\Dotenv(__DIR__.'/..', 'app.env');
$dotenv = new Dotenv\Dotenv(__DIR__, 'app.env');
$dotenv->load();
// Checks & validation
......
......@@ -10,11 +10,11 @@
*/
// Define application aliases
Yii::setAlias('@app', dirname(__DIR__).'/..');
Yii::setAlias('@root', '@app/..');
Yii::setAlias('@runtime', dirname(__DIR__).'/../../runtime');
Yii::setAlias('@web', dirname(__DIR__).'/../web');
Yii::setAlias('@webroot', dirname(__DIR__).'/web');
Yii::setAlias('@app', dirname(__DIR__).'/../src');
Yii::setAlias('@root', '..');
Yii::setAlias('@runtime', '@root/runtime');
Yii::setAlias('@web', '@root/web');
Yii::setAlias('@webroot', '/');
// Load $merge configuration files
$applicationType = php_sapi_name() == 'cli' ? 'console' : 'web';
......
......@@ -3,12 +3,12 @@ services:
php:
build: .
environment:
- PHP_USER_ID=82
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN}
- GITHUB_API_TOKEN
volumes:
- ./composer.json:/app/composer.json
- ./composer.lock:/app/composer.lock
- ./vendor:/app/vendor
- ./config:/app/config
- ./src:/app/src
- ./web:/app/web
- ./tests:/app/tests
......
......@@ -2,13 +2,13 @@
$rootPath = __DIR__.'/..';
require($rootPath.'/vendor/autoload.php');
require($rootPath.'/src/config/env.php');
require($rootPath.'/config/env.php');
defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
require($rootPath.'/vendor/yiisoft/yii2/Yii.php');
$config = require($rootPath.'/src/config/main.php');
$config = require($rootPath.'/config/main.php');
$application = new yii\web\Application($config);
$application->run();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment