Skip to content

Instantly share code, notes, and snippets.

@ilourt
Created January 22, 2018 16:04
Show Gist options
  • Save ilourt/2fff392b9ec2a04c4249bc8dc4c63790 to your computer and use it in GitHub Desktop.
Save ilourt/2fff392b9ec2a04c4249bc8dc4c63790 to your computer and use it in GitHub Desktop.
Start script to use with systemd to take into account env var
#!/bin/bash
# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
echo $SCRIPTPATH
export $(cat ${SCRIPTPATH}/.env | xargs)
docker-compose -f ${SCRIPTPATH}/docker-compose.yml up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment