Skip to content

Commit d960d4d

Browse files
committed
Build this docker image as a base image
1 parent 399d6ad commit d960d4d

4 files changed

Lines changed: 13 additions & 24 deletions

File tree

Dockerfile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,3 @@ RUN apt-get update && apt-get install -y git zip unzip
1515

1616
RUN composer install
1717

18-
##
19-
## Below is temporary until this is converted to a base image
20-
##
21-
22-
# Get the sdk repo if it doesn't exist
23-
RUN apt-get update && apt-get install -y git
24-
RUN if [ ! -d "sdk-php" ]; then git clone --depth 1 https://github.com/ProcessMaker/sdk-php.git; fi
25-
RUN mv sdk-php /opt/
26-
RUN composer config repositories.sdk-php path /opt/sdk-php
27-
RUN composer require ProcessMaker/sdk-php:@dev
28-
29-
# Get the last AWS-SDK version
30-
RUN apt-get install zip unzip -y
31-
RUN composer require aws/aws-sdk-php

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Build
2+
```
3+
docker build -t processmaker4/executor-php:latest .
4+
```
5+
16
# executor-php
27
Script Task Executor Engine with PHP Runtime
38

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "processmaker/docker-executor-php",
33
"friendly_name": "PHP Docker Executor",
44
"description": "PHP script executor for processmaker 4",
5-
"version": "0.0.1",
5+
"version": "1.0.0",
66
"minimum-stability": "dev",
77
"autoload": {
88
"psr-4": {

src/DockerExecutorPhpServiceProvider.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,32 @@ class DockerExecutorPhpServiceProvider extends ServiceProvider
99
{
1010
use PluginServiceProviderTrait;
1111

12-
const version = '0.0.1'; // Required for PluginServiceProviderTrait
12+
const version = '1.0.0'; // Required for PluginServiceProviderTrait
1313

1414
public function register()
1515
{
1616
}
1717

1818
public function boot()
1919
{
20-
$image = env('SCRIPTS_PHP_IMAGE', 'processmaker4/executor-php');
21-
$dockerDir = sys_get_temp_dir() . "/pm4-docker-builds/php";
22-
$sdkDir = $dockerDir . "/sdk";
20+
// Note: `processmaker4/executor-php` is now the base image that the instance inherits from
21+
$image = env('SCRIPTS_PHP_IMAGE', 'processmaker4/executor-instance-php:v1.0.0');
2322

2423
\Artisan::command('docker-executor-php:install', function () {
2524
// Restart the workers so they know about the new supported language
2625
\Artisan::call('horizon:terminate');
27-
});
2826

29-
\Artisan::command('docker-executor-php:build-base', function () {
30-
system("docker build -t processmaker4/base-php:latest " . __DIR__ . '/..');
27+
// Build the base image that `executor-instance-php` inherits from
28+
system("docker build -t processmaker4/executor-php:latest " . __DIR__ . '/..');
3129
});
32-
30+
3331
$config = [
3432
'name' => 'PHP',
3533
'runner' => 'PhpRunner',
3634
'mime_type' => 'application/x-php',
3735
'image' => $image,
3836
'options' => ['invokerPackage' => "ProcessMaker\\Client"],
39-
'init_dockerfile' => "FROM processmaker4/base-php:latest\nCOPY ./sdk /opt/pm4-sdk\nRUN composer config repositories.pm4-sdk path /opt/pm4-sdk\nRUN composer require ProcessMaker/sdk-php:@dev",
37+
'init_dockerfile' => "FROM processmaker4/executor-php:latest\nARG SDK_DIR\n",
4038
];
4139
config(['script-runners.php' => $config]);
4240

0 commit comments

Comments
 (0)