Skip to content

Commit

Permalink
moved config to separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
schmunk42 committed Jan 22, 2018
1 parent 5435a0d commit 2fc6666
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 136 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM dmstr/php-yii2:7.1-fpm-3.1-alpine-nginx
FROM yiisoftware/yii2-php:7.2-apache

WORKDIR /app

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
Expand Down
31 changes: 21 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
162 changes: 48 additions & 114 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/config/common.php → config/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/config/env.php → config/env.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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
Expand Down
10 changes: 5 additions & 5 deletions src/config/main.php → config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 2fc6666

Please sign in to comment.