Skip to content

Commit 45eaeed

Browse files
committed
5.0 constraint
1 parent 6f08bd0 commit 45eaeed

File tree

5 files changed

+78
-73
lines changed

5 files changed

+78
-73
lines changed

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
"type": "luya-kickstarter",
55
"license":"MIT",
66
"require": {
7-
"luyadev/luya-module-admin" : "^4.0",
8-
"luyadev/luya-module-cms" : "^4.0",
7+
"luyadev/luya-module-admin" : "^5.0",
8+
"luyadev/luya-module-cms" : "^5.0",
99
"luyadev/luya-bootstrap4": "^1.0",
1010
"luyadev/luya-generic" : "^1.0"
1111
},
1212
"require-dev": {
1313
"yiisoft/yii2-debug" : "^2.0",
1414
"yiisoft/yii2-gii" : "^2.0",
15-
"luyadev/luya-deployer": "^1.0",
15+
"luyadev/luya-deployer": "^3.0",
1616
"twbs/bootstrap": "^4.0"
1717
},
1818
"config": {
19-
"fxp-asset": {
20-
"enabled": false
19+
"platform": {
20+
"php": "8.2"
2121
},
2222
"allow-plugins": {
2323
"yiisoft/yii2-composer": true,

configs/config.php

+46-44
Original file line numberDiff line numberDiff line change
@@ -69,55 +69,57 @@
6969
]
7070
]);
7171

72-
$config->callback(function() {
73-
define('YII_DEBUG', true);
74-
define('YII_ENV', 'local');
75-
})->env(Config::ENV_LOCAL);
72+
/************ LOCAL ************/
7673

77-
// database config for
78-
$config->component('db', [
79-
'dsn' => 'mysql:host=localhost;dbname=DB_NAME',
80-
// 'dsn' => 'mysql:host=localhost;dbname=DB_NAME;unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock', // OSX MAMP
81-
// 'dsn' => 'mysql:host=localhost;dbname=DB_NAME;unix_socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock', // OSX XAMPP
82-
'username' => '',
83-
'password' => '',
84-
])->env(Config::ENV_LOCAL);
74+
$config->env(Config::ENV_LOCAL, function (Config $config) {
75+
$config->callback(function () {
76+
define('YII_DEBUG', true);
77+
define('YII_ENV', 'local');
78+
});
8579

86-
/*
87-
// docker mysql config
88-
$config->component('db', [
89-
'dsn' => 'mysql:host=luya_db;dbname=luya_kickstarter_101',
90-
'username' => 'luya',
91-
'password' => 'CHANGE_ME',
92-
])->env(Config::ENV_LOCAL);
93-
*/
80+
// docker mysql config
81+
$config->component('db', [
82+
'dsn' => 'mysql:host=luya_db;dbname=luya',
83+
'username' => 'luya',
84+
'password' => 'luya',
85+
]);
86+
87+
$config->component('assetManager', [
88+
'class' => 'luya\web\AssetManager',
89+
'linkAssets' => true
90+
]);
91+
92+
// debug and gii on local env
93+
$config->module('debug', [
94+
'class' => 'yii\debug\Module',
95+
'allowedIPs' => ['*'],
96+
]);
97+
$config->module('gii', [
98+
'class' => 'yii\gii\Module',
99+
'allowedIPs' => ['*'],
100+
]);
94101

95-
$config->component('db', [
96-
'dsn' => 'mysql:host=localhost;dbname=DB_NAME',
97-
'username' => '',
98-
'password' => '',
99-
'enableSchemaCache' => true,
100-
'schemaCacheDuration' => 0,
101-
])->env(Config::ENV_PROD);
102+
$config->bootstrap(['debug', 'gii']);
103+
});
102104

103-
$config->component('cache', [
104-
'class' => 'yii\caching\FileCache'
105-
])->env(Config::ENV_PROD);
105+
/************ PROD ************/
106106

107-
$config->application([
108-
'ensureSecureConnection' => true, // https://luya.io/guide/app-security
109-
])->env(Config::ENV_PROD);
107+
$config->env(Config::ENV_PROD, function (Config $config) {
108+
$config->component('db', [
109+
'dsn' => 'mysql:host=localhost;dbname=DB_NAME',
110+
'username' => '',
111+
'password' => '',
112+
'enableSchemaCache' => true,
113+
'schemaCacheDuration' => 0,
114+
]);
110115

111-
// debug and gii on local env
112-
$config->module('debug', [
113-
'class' => 'yii\debug\Module',
114-
'allowedIPs' => ['*'],
115-
])->env(Config::ENV_LOCAL);
116-
$config->module('gii', [
117-
'class' => 'yii\gii\Module',
118-
'allowedIPs' => ['*'],
119-
])->env(Config::ENV_LOCAL);
120-
121-
$config->bootstrap(['debug', 'gii'])->env(Config::ENV_LOCAL);
116+
$config->component('cache', [
117+
'class' => 'yii\caching\FileCache'
118+
]);
119+
120+
$config->application([
121+
'ensureSecureConnection' => true, // https://luya.io/guide/app-security
122+
]);
123+
});
122124

123125
return $config;

deploy.php

+8-20
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
<?php
22

3-
require 'vendor/luyadev/luya-deployer/luya.php';
3+
namespace Deployer;
44

5-
// DEV environment
6-
server('dev', 'server.tld', 22)
7-
->user('username')
8-
->password('password')
9-
->stage('dev')
10-
->env('deploy_path', '/path/to/dev/project/public_html');
5+
require 'vendor/luyadev/luya-deployer/luya.php';
116

12-
// Preproduction environment
13-
server('prep', 'server.tld', 22)
14-
->user('username')
15-
->password('password')
16-
->stage('prep')
17-
->env('deploy_path', '/path/to/prep/project/public_html');
7+
host('SSH_HOST')
8+
->setLabels(['stage' => 'prod'])
9+
->set('remote_user', 'SSH_USER_NAME')
10+
->set('deploy_path', '~/httpdocs');
1811

19-
// Production environment
20-
server('prod', 'server.tld', 22)
21-
->user('username')
22-
->password('password')
23-
->stage('prod')
24-
->env('deploy_path', '/path/to/prod/project/public_html');
12+
after('luya:commands', 'unglue');
2513

26-
set('repository', 'https://user:password@github.com/organisation/repository.git');
14+
set('repository', 'https://USER:PASSWORD@github.com/VENDOR/REPO.git');

docker-compose.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
version: '3'
22
services:
3+
34
luya_composer:
4-
image: composer:latest
5+
image: composer
56
volumes:
67
- ./:/app
78
command: composer install
9+
810
luya_db:
911
image: mysql:5.7
1012
command:
1113
- --character-set-server=utf8
1214
- --collation-server=utf8_general_ci
1315
environment:
1416
MYSQL_ROOT_PASSWORD: luya
15-
MYSQL_DATABASE: luya_core
17+
MYSQL_DATABASE: luya
1618
MYSQL_USER: luya
1719
MYSQL_PASSWORD: luya
20+
ports:
21+
- "3306:3306"
22+
1823
luya_web:
19-
image: luyadev/luya-docker:nginx-fpm-php74
24+
image: registry.gitlab.com/zephir.ch/foss/luya-docker:php82
2025
volumes:
21-
- ./:/app
26+
- ./localphp.ini:/etc/php82/conf.d/zzz_custom.ini
27+
- ./:/var/www/html
28+
healthcheck:
29+
disable: true

localphp.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[opcache]
2+
opcache.validate_timestamps=1
3+
opcache.revalidate_freq=1
4+
[PHP]
5+
display_errors = On
6+
log_errors = On
7+
error_reporting = E_ALL

0 commit comments

Comments
 (0)