1 | <?php |
||
12 | class Module extends \yii\base\Module |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @var bool Whether the container should attempt to run migrations on launch. |
||
17 | */ |
||
18 | public $runMigrations = false; |
||
19 | |||
20 | /** |
||
21 | * @var bool whether migrations should acquire a lock. |
||
22 | * It must be configured in the 'mutex' component of this module or the application |
||
23 | * Note that this mutex must be shared between all instances of your application. |
||
24 | * Consider using something like redis or mysql mutex. |
||
25 | */ |
||
26 | public $migrationsUseMutex = true; |
||
27 | |||
28 | /** |
||
29 | * The variables will be written to /runtime/env.json as JSON, where your application can read them. |
||
30 | * @var string[] List of required environment variables. If one is missing the container will exit. |
||
31 | * |
||
32 | */ |
||
33 | public $environmentVariables = []; |
||
34 | |||
35 | /** |
||
36 | * @var array Pool directives |
||
37 | * @see http://php.net/manual/en/install.fpm.configuration.php |
||
38 | * |
||
39 | */ |
||
40 | public $poolConfig = [ |
||
41 | 'user' => 'nobody', |
||
42 | 'group' => 'nobody', |
||
43 | 'listen' => 9000, |
||
44 | 'pm' => 'dynamic', |
||
45 | 'pm.max_children' => 40, |
||
46 | 'pm.start_servers' => 3, |
||
47 | 'pm.min_spare_servers' => 1, |
||
48 | 'pm.max_spare_servers' => 3, |
||
49 | 'access.log' => '/proc/self/fd/2', |
||
50 | 'clear_env' => 'yes', |
||
51 | 'catch_workers_output' => 'yes' |
||
52 | ]; |
||
53 | |||
54 | /** |
||
55 | * @var array PHP configuration, supplied via php_admin_value in fpm config. |
||
56 | */ |
||
57 | public $phpConfig = [ |
||
58 | 'upload_max_filesize' => '20M', |
||
59 | 'post_max_size' => '25M' |
||
60 | ]; |
||
61 | |||
62 | /** |
||
63 | * @var array Global directives |
||
64 | * @see http://php.net/manual/en/install.fpm.configuration.php |
||
65 | * |
||
66 | */ |
||
67 | public $fpmConfig = [ |
||
68 | 'error_log' => '/proc/self/fd/2', |
||
69 | 'daemonize' => 'no', |
||
70 | ]; |
||
71 | |||
72 | public $extensions = [ |
||
73 | 'ctype', |
||
74 | 'gd', |
||
75 | 'iconv', |
||
76 | 'intl', |
||
77 | 'json', |
||
78 | 'mbstring', |
||
79 | 'session', |
||
80 | 'pdo_mysql', |
||
81 | 'session', |
||
82 | 'curl' |
||
83 | ]; |
||
84 | |||
85 | /** |
||
86 | * @var string The name of the created image. |
||
87 | */ |
||
88 | public $image; |
||
89 | |||
90 | /** |
||
91 | * @var string The tag of the created image. |
||
92 | */ |
||
93 | public $tag = 'latest'; |
||
94 | |||
95 | /** |
||
96 | * @var bool wheter to push successful builds. |
||
97 | */ |
||
98 | public $push = false; |
||
99 | |||
100 | /** |
||
101 | * @var string Location of composer.json / composer.lock |
||
102 | */ |
||
103 | public $composerFilePath = '@app/../'; |
||
104 | /** |
||
105 | * @return string A PHP-FPM config file. |
||
106 | */ |
||
107 | 3 | protected function createFpmConfig() |
|
133 | |||
134 | /** |
||
135 | * @return string A shell script that checks for existence of (non-empty) variables and runs php-fpm. |
||
136 | */ |
||
137 | 3 | protected function createEntrypoint(): string |
|
195 | |||
196 | 3 | public function createBuildContext(): Context |
|
256 | |||
257 | 3 | public function getLock(int $timeout = 0) |
|
272 | |||
273 | /** |
||
274 | * @throws InvalidConfigException in case the app is not configured as expected |
||
275 | * @return string the relative path of the (console) entry script with respect to the project (not app) root. |
||
276 | */ |
||
277 | 3 | private function getConsoleEntryScript(): string |
|
286 | } |