update 6 docker CI
This commit is contained in:
@@ -18,3 +18,23 @@ ENV APP_DIR=/app
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
COPY . ${APP_DIR}
|
||||
|
||||
RUN printf '%s\n' \
|
||||
'#!/bin/sh' \
|
||||
'set -e' \
|
||||
'if [ -z "${APP_KEY:-}" ]; then' \
|
||||
' if command -v php >/dev/null 2>&1; then' \
|
||||
' APP_KEY=$(php -r '"'"'echo "base64:" . base64_encode(random_bytes(32));'"'"')' \
|
||||
' elif command -v openssl >/dev/null 2>&1; then' \
|
||||
' APP_KEY=$(openssl rand -base64 32 | sed "s/^/base64:/")' \
|
||||
' else' \
|
||||
' echo "APP_KEY is required but php/openssl is unavailable." >&2' \
|
||||
' exit 1' \
|
||||
' fi' \
|
||||
' export APP_KEY' \
|
||||
'fi' \
|
||||
'exec "$@"' \
|
||||
> /usr/local/bin/ci-entrypoint \
|
||||
&& chmod +x /usr/local/bin/ci-entrypoint
|
||||
|
||||
ENTRYPOINT ["ci-entrypoint"]
|
||||
|
||||
Reference in New Issue
Block a user