Skip to content

Commit 71b4371

Browse files
committed
Restore bootstrap.sh else Lambda complains the PHP runtime process exited
1 parent 08718e7 commit 71b4371

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

php-82/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,11 @@ COPY --link --from=build-environment /bref-layer /opt
537537
COPY --link src/php.ini /opt/bref/etc/php/conf.d/bref.ini
538538
COPY --link src/php-fpm.conf /opt/bref/etc/php-fpm.conf
539539

540-
COPY --link src/bootstrap.php /opt/bootstrap
540+
COPY --link src/bootstrap.sh /opt/bootstrap
541541
# Copy files to /var/runtime to support deploying as a Docker image
542-
COPY --link src/bootstrap.php /var/runtime/bootstrap
542+
COPY --link src/bootstrap.sh /var/runtime/bootstrap
543543
RUN chmod +x /opt/bootstrap && chmod +x /var/runtime/bootstrap
544+
COPY --link src/bootstrap.php /opt/bref/bootstrap.php
544545

545546

546547
# ----------------------------------------------------------------------------

php-83/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,11 @@ COPY --link --from=build-environment /bref-layer /opt
537537
COPY --link src/php.ini /opt/bref/etc/php/conf.d/bref.ini
538538
COPY --link src/php-fpm.conf /opt/bref/etc/php-fpm.conf
539539

540-
COPY --link src/bootstrap.php /opt/bootstrap
540+
COPY --link src/bootstrap.sh /opt/bootstrap
541541
# Copy files to /var/runtime to support deploying as a Docker image
542-
COPY --link src/bootstrap.php /var/runtime/bootstrap
542+
COPY --link src/bootstrap.sh /var/runtime/bootstrap
543543
RUN chmod +x /opt/bootstrap && chmod +x /var/runtime/bootstrap
544+
COPY --link src/bootstrap.php /opt/bref/bootstrap.php
544545

545546

546547
# ----------------------------------------------------------------------------

php-84/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,11 @@ COPY --link --from=build-environment /bref-layer /opt
538538
COPY --link src/php.ini /opt/bref/etc/php/conf.d/bref.ini
539539
COPY --link src/php-fpm.conf /opt/bref/etc/php-fpm.conf
540540

541-
COPY --link src/bootstrap.php /opt/bootstrap
541+
COPY --link src/bootstrap.sh /opt/bootstrap
542542
# Copy files to /var/runtime to support deploying as a Docker image
543-
COPY --link src/bootstrap.php /var/runtime/bootstrap
543+
COPY --link src/bootstrap.sh /var/runtime/bootstrap
544544
RUN chmod +x /opt/bootstrap && chmod +x /var/runtime/bootstrap
545+
COPY --link src/bootstrap.php /opt/bref/bootstrap.php
545546

546547

547548
# ----------------------------------------------------------------------------

src/bootstrap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env php
21
<?php declare(strict_types=1);
32

43
$appRoot = getenv('LAMBDA_TASK_ROOT');

src/bootstrap.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# Fail on error
4+
set -e
5+
6+
while true
7+
do
8+
# We redirect stderr to stdout so that everything
9+
# written on the output ends up in Cloudwatch automatically
10+
php "/opt/bref/bootstrap.php" 2>&1
11+
done

0 commit comments

Comments
 (0)