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"]
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
working_dir: /app
|
||||
environment:
|
||||
APP_ENV: testing
|
||||
APP_KEY: base64:testingKey123456789012345678901234567890=
|
||||
APP_KEY: ${APP_KEY:-}
|
||||
DB_CONNECTION: sqlite
|
||||
DB_DATABASE: /app/database/database.sqlite
|
||||
CACHE_DRIVER: array
|
||||
|
||||
Reference in New Issue
Block a user