Skip to content

Commit

Permalink
Remove .env file generation from entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rjhenry committed Jul 18, 2023
1 parent cd66a5e commit 152145a
Showing 1 changed file with 2 additions and 80 deletions.
82 changes: 2 additions & 80 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,86 +7,8 @@ echoerr() { echo "$@" 1>&2; }
IFS=":" read -r DB_HOST_NAME DB_PORT <<< "$DB_HOST"
DB_PORT=${DB_PORT:-3306}

if [ ! -f ".env" ]; then
if [[ "${DB_HOST}" ]]; then
cat > ".env" <<EOF
# Environment
APP_ENV=production
APP_DEBUG=${APP_DEBUG:-false}
APP_KEY=${APP_KEY:-SomeRandomStringWith32Characters}
# The below url has to be set if using social auth options
# or if you are not using BookStack at the root path of your domain.
APP_URL=${APP_URL:-null}
# Database details
DB_HOST=${DB_HOST:-localhost}
DB_DATABASE=${DB_DATABASE:-bookstack}
DB_USERNAME=${DB_USERNAME:-bookstack}
DB_PASSWORD=${DB_PASSWORD:-password}
# Cache and session
CACHE_DRIVER=file
SESSION_DRIVER=file
# If using Memcached, comment the above and uncomment these
#CACHE_DRIVER=memcached
#SESSION_DRIVER=memcached
QUEUE_DRIVER=sync
# Memcached settings
# If using a UNIX socket path for the host, set the port to 0
# This follows the following format: HOST:PORT:WEIGHT
# For multiple servers separate with a comma
MEMCACHED_SERVERS=127.0.0.1:11211:100
# Storage
STORAGE_TYPE=${STORAGE_TYPE:-local}
# Amazon S3 Config
STORAGE_S3_KEY=${STORAGE_S3_KEY:-false}
STORAGE_S3_SECRET=${STORAGE_S3_SECRET:-false}
STORAGE_S3_REGION=${STORAGE_S3_REGION:-false}
STORAGE_S3_BUCKET=${STORAGE_S3_BUCKET:-false}
# Storage URL
# Used to prefix image urls for when using custom domains/cdns
STORAGE_URL=${STORAGE_URL:-false}
# General auth
AUTH_METHOD=${AUTH_METHOD:-standard}
# Social Authentication information. Defaults as off.
GITHUB_APP_ID=${GITHUB_APP_ID:-false}
GITHUB_APP_SECRET=${GITHUB_APP_SECRET:-false}
GOOGLE_APP_ID=${GOOGLE_APP_ID:-false}
GOOGLE_APP_SECRET=${GOOGLE_APP_SECRET:-false}
# External services such as Gravatar
DISABLE_EXTERNAL_SERVICES=${DISABLE_EXTERNAL_SERVICES:-false}
# LDAP Settings
LDAP_SERVER=${LDAP_SERVER:-false}
LDAP_BASE_DN=${LDAP_BASE_DN:-false}
LDAP_DN=${LDAP_DN:-false}
LDAP_PASS=${LDAP_PASS:-false}
LDAP_USER_FILTER=${LDAP_USER_FILTER:-false}
LDAP_VERSION=${LDAP_VERSION:-false}
LDAP_ID_ATTRIBUTE=${LDAP_ID_ATTRIBUTE:-false}
LDAP_TLS_INSECURE=${LDAP_TLS_INSECURE:-false}
LDAP_DISPLAY_NAME_ATTRIBUTE=${LDAP_DISPLAY_NAME_ATTRIBUTE:-false}
# Mail settings
MAIL_DRIVER=${MAIL_DRIVER:-smtp}
MAIL_HOST=${MAIL_HOST:-localhost}
MAIL_PORT=${MAIL_PORT:-1025}
MAIL_USERNAME=${MAIL_USERNAME:-null}
MAIL_PASSWORD=${MAIL_PASSWORD:-null}
MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null}
# URL used for social login redirects, NO TRAILING SLASH
EOF
else
echo >&2 'error: missing DB_HOST environment variable'
exit 1
fi
fi
# Ensure these is no local .env file
[ -f ".env" ] && rm .env

echoerr "wait-for-db: waiting for ${DB_HOST_NAME}:${DB_PORT}"

Expand Down

0 comments on commit 152145a

Please sign in to comment.