Skip to content

Instantly share code, notes, and snippets.

@Nicolab
Forked from ilourt/start_docker_compose.sh
Created January 23, 2018 08:46
Show Gist options
  • Save Nicolab/bd64a4c64ff7e8cc555bb694d53b0edb to your computer and use it in GitHub Desktop.
Save Nicolab/bd64a4c64ff7e8cc555bb694d53b0edb 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