feat(): add tini as process manager

This commit is contained in:
valvin 2020-03-08 20:47:56 +01:00
parent 4755d3f602
commit 9e25e43fb9
16 changed files with 68 additions and 11 deletions

View File

@ -11,9 +11,19 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
# For tini installation
gnupg dirmngr \
; \
rm -rf /var/lib/apt/lists/*;
# Add tini for reaping processes
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /sbin/tini \
&& chmod +x /sbin/tini
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/
RUN set -ex; \

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -8,7 +8,8 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
shadow;
shadow \
tini;
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -11,9 +11,19 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
# For tini installation
gnupg dirmngr \
; \
rm -rf /var/lib/apt/lists/*;
# Add tini for reaping processes
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /sbin/tini \
&& chmod +x /sbin/tini
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/
RUN set -ex; \

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -11,9 +11,19 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
# For tini installation
gnupg dirmngr \
; \
rm -rf /var/lib/apt/lists/*;
# Add tini for reaping processes
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /sbin/tini \
&& chmod +x /sbin/tini
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/
RUN set -ex; \

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -8,7 +8,8 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
shadow;
shadow \
tini;
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -11,9 +11,19 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
# For tini installation
gnupg dirmngr \
; \
rm -rf /var/lib/apt/lists/*;
# Add tini for reaping processes
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /sbin/tini \
&& chmod +x /sbin/tini
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/
RUN set -ex; \

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -7,7 +7,8 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
shadow;
shadow \
tini;
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/

View File

@ -10,9 +10,19 @@ RUN set -ex; \
git \
# For mail() support
ssmtp \
# For tini installation
gnupg dirmngr \
; \
rm -rf /var/lib/apt/lists/*;
# Add tini for reaping processes
ENV TINI_VERSION v%%TINI_VERSION%%
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /sbin/tini \
&& chmod +x /sbin/tini
# install the PHP extensions we need
# see https://friendi.ca/resources/requirements/
RUN set -ex; \

View File

@ -7,7 +7,7 @@ done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
php /var/www/html/bin/daemon.php -f start
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2
fi

View File

@ -28,6 +28,9 @@ declare -A entrypoints=(
[develop]='entrypoint-dev.sh'
)
# Only for debian variant
tini_version="0.18.0"
apcu_version="$(
git ls-remote --tags https://github.com/krakjoe/apcu.git \
| cut -d/ -f3 \
@ -122,6 +125,7 @@ function create_variant() {
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
s/%%ENTRYPOINT%%/'"${entrypoints[$install_type]}"'/g;
s/%%TINI_VERSION%%/'"${tini_version}"'/g;
' "$dir/Dockerfile"
for name in entrypoint cron; do
@ -162,4 +166,4 @@ echo "$travisAmd64" > .travis.yml
travisFull="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" && $5 == "(full)" { $0 = " - stage: test images (full)'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
echo "$travisFull" > .travis.yml
echo "$travisFull" > .travis.yml