Skip to content

Instantly share code, notes, and snippets.

@benfavre
Created September 26, 2016 15:12
Show Gist options
  • Save benfavre/13dd77d145447b80c00174d38ad69de3 to your computer and use it in GitHub Desktop.
Save benfavre/13dd77d145447b80c00174d38ad69de3 to your computer and use it in GitHub Desktop.
Boot file
#!/bin/sh
export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive
echo "App boot script"
export APP_DATABASE_HOST="db"
echo "Setup env variables"
/sbin/setuser www-app cp /var/www/html/.env.example /var/www/html/.env && \
sed -i "s|%database_name%|${APP_DATABASE_NAME}|g" /var/www/html/.env && \
sed -i "s|%database_user%|${APP_DATABASE_USER}|g" /var/www/html/.env && \
sed -i "s|%database_password%|${APP_DATABASE_PASSWORD}|g" /var/www/html/.env && \
sed -i "s|%database_host%|${APP_DATABASE_HOST}|g" /var/www/html/.env && \
sed -i "s|%app_environment%|${APP_ENV}|g" /var/www/html/.env && \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment