Skip to content

Instantly share code, notes, and snippets.

@chadwcarlson
Created November 29, 2023 15:01
Show Gist options
  • Save chadwcarlson/0153ff59add0f45a20d127d0c775ad5a to your computer and use it in GitHub Desktop.
Save chadwcarlson/0153ff59add0f45a20d127d0c775ad5a to your computer and use it in GitHub Desktop.
Replacing laravel bridge
# Set database environment variables
export DB_HOST="$MARIADB_HOST"
export DB_PORT="$MARIADB_PORT"
export DB_PATH="$MARIADB_PATH"
export DB_USERNAME="$MARIADB_USERNAME"
export DB_PASSWORD="$MARIADB_PASSWORD"
export DB_SCHEME="$MARIADB_SCHEME"
export DATABASE_URL="${DB_SCHEME}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_PATH}"
# Set Laravel-specific environment variables
export DB_CONNECTION="$DB_SCHEME"
export DB_DATABASE="$DB_PATH"
# Set Cache environment variables
export CACHE_HOST="$REDIS_HOST"
export CACHE_PORT="$REDIS_PORT"
export CACHE_SCHEME="$REDIS_SCHEME"
export CACHE_URL="${CACHE_SCHEME}://${CACHE_HOST}:${CACHE_PORT}"
# Set Redis environment variables
export REDIS_URL="$CACHE_URL"
export CACHE_DRIVER=redis
export SESSION_DRIVER=redis
export REDIS_CLIENT=phpredis
# App configuration
export APP_NAME=laravel
# This configuration runs your application in `development` by default initially to help you troubleshoot if necessary.
# Once deployed, you can update the below if desired.
export APP_ENV=production
# Depending on your needs, you can keep `APP_ENV` always set to production, or dependent on the current environment type.
# export APP_ENV="$PLATFORM_ENVIRONMENT_TYPE"
# If its necessary to debug an environment, uncomment the below lines.
# export APP_DEBUG=true
# export APP_ENV=local
# Laravel requires a random, 32 character string.
export APP_KEY=$(python3 -c 'import os; print(os.getenv("PLATFORM_PROJECT_ENTROPY")[:32])')
export APP_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r 'to_entries[] | select(.value.primary == true) | .key')
export SESSION_SECURE_COOKIE=1
# Email
export MAIL_HOST="$PLATFORM_SMTP_HOST"
export MAIL_DRIVER=smtp
# From Laravel 7 onwards MAIL_DRIVER is renamed to MAIL_MAILER
export MAIL_MAILER=smtp
export MAIL_PORT=25
# Disable TLS with mail, as it isn’t needed or supported within {{ .Assets.ServiceName }}’s network.
# Note that doing so is only supported on Laravel 6.0.4 and later.
# On earlier versions, you must manually modify `mail.php` and set `encryption` to `null`:
export MAIL_ENCRYPTION=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment