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