Update build.sh
This commit is contained in:
18
build.sh
18
build.sh
@@ -25,14 +25,30 @@ docker stop $APP_NAME
|
||||
docker rm $APP_NAME
|
||||
docker build -t $APP_NAME .
|
||||
|
||||
# Create a persistent file storage
|
||||
# SECTION: Startup jobs zu crontab hinzufügen.
|
||||
# Erstmal den cronfile leeren.
|
||||
crontab -r;
|
||||
|
||||
# Alle builds schlagen fehl wenn die Datenbank nicht da ist, also muss der Container zuerst gebaut werden.
|
||||
(crontab -l ; echo "@reboot sudo ~/database/build.sh &") | crontab -;
|
||||
(crontab -l ; echo "@reboot sudo ~/apps/online-energieausweis/build.sh &") | crontab -;
|
||||
(crontab -l ; echo "@reboot sudo ~/apps/layout-tool/build.sh &") | crontab -;
|
||||
|
||||
# Wir legen ein persistent directory an
|
||||
PERSISTENT_DIR="${HOME}/persistent/online-energieausweis";
|
||||
mkdir -p $PERSISTENT_DIR;
|
||||
|
||||
# Wir legen einen .env file für unsere letsencrypt keys an.
|
||||
rm -f ~/apps/$APP_NAME/.env;
|
||||
touch ~/apps/$APP_NAME/.env;
|
||||
echo "PRIVATE_KEY=$(cat /etc/letsencrypt/live/ibcornelsen.de/privkey.pem | base64 | tr -d '\n')" >> ~/apps/$APP_NAME/.env;
|
||||
echo "CERTIFICATE=$(cat /etc/letsencrypt/live/ibcornelsen.de/fullchain.pem | base64 | tr -d '\n')" >> ~/apps/$APP_NAME/.env;
|
||||
|
||||
# Und starten unsere App wieder.
|
||||
docker run -d --name $APP_NAME --link $DB_CONTAINER_NAME \
|
||||
-v "${PERSISTENT_DIR}:/persistent" \
|
||||
-p "$APP_PORT:80" \
|
||||
-e DB_CONNECTION=postgresql://$DB_USER:$DB_PASSWORD@${DB_CONTAINER_NAME}:$DB_PORT/$DB_NAME \
|
||||
-e DB_PORT=$DB_PORT \
|
||||
--env-file ~/apps/$APP_NAME/.env \
|
||||
$APP_NAME;
|
||||
|
||||
Reference in New Issue
Block a user