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 WORKDIR /app
...@@ -6,6 +6,7 @@ ADD composer.lock composer.json /app/ ...@@ -6,6 +6,7 @@ ADD composer.lock composer.json /app/
RUN composer install --prefer-dist --optimize-autoloader RUN composer install --prefer-dist --optimize-autoloader
ADD yii /app/ ADD yii /app/
ADD ./config /app/config
ADD ./web /app/web/ ADD ./web /app/web/
ADD ./src /app/src/ ADD ./src /app/src/
RUN cp src/app.env-dist src/app.env RUN cp src/app.env-dist src/app.env
......
...@@ -3,19 +3,30 @@ ...@@ -3,19 +3,30 @@
"minimum-stability": "stable", "minimum-stability": "stable",
"require": { "require": {
"vlucas/phpdotenv": "2.*", "vlucas/phpdotenv": "2.*",
"yiisoft/yii2": "^2.0.8", "yiisoft/yii2": "^2.0.13",
"yiisoft/yii2-bootstrap": "2.*", "yiisoft/yii2-bootstrap": "2.*",
"yiisoft/yii2-debug": "2.*", "yiisoft/yii2-debug": "2.*",
"codemix/yii2-streamlog": "^1.0.0" "codemix/yii2-streamlog": "^1.0.0"
}, },
"extra": { "repositories": [
"asset-installer-paths": { {
"npm-asset-library": "vendor/npm", "type": "composer",
"bower-asset-library": "vendor/bower" "url": "https://asset-packagist.org"
}, }
"asset-vcs-driver-options": { ],
"github-no-api": true "config": {
}, "fxp-asset": {
"asset-pattern-skip-version": "(-build|-patch)" "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 @@ ...@@ -13,7 +13,7 @@
return [ return [
'id' => 'app', 'id' => 'app',
'language' => 'en', 'language' => 'en',
'basePath' => dirname(__DIR__), 'basePath' => dirname(__DIR__).'/src',
'vendorPath' => '@app/../vendor', 'vendorPath' => '@app/../vendor',
'runtimePath' => '@app/../runtime', 'runtimePath' => '@app/../runtime',
// Bootstrapped modules are loaded in every request // Bootstrapped modules are loaded in every request
......
...@@ -14,7 +14,7 @@ $version = is_file(__DIR__.'/../version') ? file_get_contents(__DIR__.'/../versi ...@@ -14,7 +14,7 @@ $version = is_file(__DIR__.'/../version') ? file_get_contents(__DIR__.'/../versi
defined('APP_VERSION') or define('APP_VERSION', $version); defined('APP_VERSION') or define('APP_VERSION', $version);
// Load default settings via dotenv from file // Load default settings via dotenv from file
$dotenv = new Dotenv\Dotenv(__DIR__.'/..', 'app.env'); $dotenv = new Dotenv\Dotenv(__DIR__, 'app.env');
$dotenv->load(); $dotenv->load();
// Checks & validation // Checks & validation
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
*/ */
// Define application aliases // Define application aliases
Yii::setAlias('@app', dirname(__DIR__).'/..'); Yii::setAlias('@app', dirname(__DIR__).'/../src');
Yii::setAlias('@root', '@app/..'); Yii::setAlias('@root', '..');
Yii::setAlias('@runtime', dirname(__DIR__).'/../../runtime'); Yii::setAlias('@runtime', '@root/runtime');
Yii::setAlias('@web', dirname(__DIR__).'/../web'); Yii::setAlias('@web', '@root/web');
Yii::setAlias('@webroot', dirname(__DIR__).'/web'); Yii::setAlias('@webroot', '/');
// Load $merge configuration files // Load $merge configuration files
$applicationType = php_sapi_name() == 'cli' ? 'console' : 'web'; $applicationType = php_sapi_name() == 'cli' ? 'console' : 'web';
......
...@@ -3,12 +3,12 @@ services: ...@@ -3,12 +3,12 @@ services:
php: php:
build: . build: .
environment: environment:
- PHP_USER_ID=82 - GITHUB_API_TOKEN
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN}
volumes: volumes:
- ./composer.json:/app/composer.json - ./composer.json:/app/composer.json
- ./composer.lock:/app/composer.lock - ./composer.lock:/app/composer.lock
- ./vendor:/app/vendor - ./vendor:/app/vendor
- ./config:/app/config
- ./src:/app/src - ./src:/app/src
- ./web:/app/web - ./web:/app/web
- ./tests:/app/tests - ./tests:/app/tests
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
$rootPath = __DIR__.'/..'; $rootPath = __DIR__.'/..';
require($rootPath.'/vendor/autoload.php'); 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_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV')); defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
require($rootPath.'/vendor/yiisoft/yii2/Yii.php'); 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 = new yii\web\Application($config);
$application->run(); $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