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