Skip to content

Commit

Permalink
change to new docker compose structure without docker folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jan 28, 2020
1 parent 3af712e commit 6714e06
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 223 deletions.
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"whichbrowser/parser": "^2.0"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0"
"yiisoft/yii2-debug": "^2.0",
"yiisoft/yii2-gii": "^2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -33,24 +33,25 @@
"luya\\crawler\\": "repos/luya-module-crawler/src/"
}
},

"config": {
"fxp-asset": {
"pattern-skip-version": "(-build|-patch)",
"installer-paths": {
"bower-asset-library": "vendor/bower"
}
"enabled": false
}
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"devconfig.json": "0777"
}
]
},
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
58 changes: 58 additions & 0 deletions configs/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

use luya\Config;

define('YII_DEBUG', true);
define('YII_ENV', 'local');

$config = new Config('testenv', dirname(__DIR__), [
'siteTitle' => 'LUYA Test Env',
'defaultRoute' => 'cms',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'modules' => [
'cms' => 'luya\cms\frontend\Module',
'cmsadmin' => [
'class' => 'luya\cms\admin\Module',
],
'admin' => [
'class' => 'luya\admin\Module',
'interfaceLanguage' => 'en',
'secureLogin' => false,
],
'debug' => [
'class' => 'yii\debug\Module',
'allowedIPs' => ['*'],
],
'gii' => [
'class' => 'yii\gii\Module',
'allowedIPs' => ['*'],
]
],
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'charset' => 'utf8',
],
'cache' => [
'class' => 'yii\caching\DummyCache',
],
'assetManager' => [
'class' => 'luya\web\AssetManager',
'linkAssets' => true,
],
],
'bootstrap' => [
'luya\cms\frontend\Bootstrap', 'luya\admin\Bootstrap', 'debug', 'gii',
]
]);

$config->component('db', [
'dsn' => 'mysql:host=luya_db;dbname=luya_env_dev',
'username' => 'luya',
'password' => 'luya',
])->env(Config::ENV_LOCAL);

return $config;
19 changes: 0 additions & 19 deletions configs/env-local-db.php.dist

This file was deleted.

45 changes: 0 additions & 45 deletions configs/env-local.php

This file was deleted.

11 changes: 4 additions & 7 deletions configs/env.php.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php
<?php

$config = require 'config.php';

/**
* env.php returns the current configuration instance and must be in the ignore section of your VCS.
*/

// in this case we return the pre production configs:
return require 'env-local.php';
return $config->toArray([\luya\Config::ENV_LOCAL]);
18 changes: 4 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,32 @@ version: '2'

services:
luya_composer:
build:
context: ./docker/composer
args:
GITHUB_TOKEN: ${GITHUB_TOKEN}
image: composer
volumes:
- ./:/app
- ./docker/env.php:/app/configs/env.php
- ./docker/env-local-db.php:/app/configs/env-local-db.php
command: composer install
luya_php:
image: luyadev/luya-docker-php
volumes:
- ./:/app
- ./docker/env.php:/app/configs/env.php
- ./docker/env-local-db.php:/app/configs/env-local-db.php
luya_db:
image: mysql:5.7
command:
- --character-set-server=utf8
- --collation-server=utf8_general_ci
environment:
MYSQL_ROOT_PASSWORD: CHANGE_ME
MYSQL_ROOT_PASSWORD: luya
MYSQL_DATABASE: luya_env_dev
MYSQL_USER: luya
MYSQL_PASSWORD: CHANGE_ME
MYSQL_PASSWORD: luya
ports:
- "3300:3306"
luya_web:
image: nginx:latest
image: luyadev/luya-docker-nginx
ports:
- "8080:80"
volumes:
- ./:/app
- ./docker/env.php:/app/configs/env.php
- ./docker/env-local-db.php:/app/configs/env-local-db.php
- ./docker/site.conf:/etc/nginx/conf.d/default.conf
unglue:
image: unglue/server
ports:
Expand Down
1 change: 0 additions & 1 deletion docker/.gitignore

This file was deleted.

80 changes: 0 additions & 80 deletions docker/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions docker/composer/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions docker/env-local-db.php

This file was deleted.

2 changes: 0 additions & 2 deletions docker/env.php

This file was deleted.

25 changes: 0 additions & 25 deletions docker/site.conf

This file was deleted.

0 comments on commit 6714e06

Please sign in to comment.