Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bootstrap script #29

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# This script attempts to bootstrap an environment, ready to
# use as a docker installation for SeAT.

# 2018 - 2020 @leonjza
# 2018 - 2023 @leonjza

set -e

SEAT_DOCKER_INSTALL=/opt/seat-docker
SEAT_GITHUB_BRANCH=5.0.x

echo "SeAT Docker Bootstrap"
echo
Expand Down Expand Up @@ -49,28 +50,18 @@ if ! [ -x "$(command -v docker)" ]; then
echo "Docker installed"
fi

# Have docker-compose?
if ! [ -x "$(command -v docker-compose)" ]; then

echo "docker-compose is not installed. Installing..."

curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

echo "docker-compose installed"
fi

# Make sure /opt/seat-docker exists
echo "Ensuring $SEAT_DOCKER_INSTALL is available..."
mkdir -p $SEAT_DOCKER_INSTALL
cd $SEAT_DOCKER_INSTALL

echo # (optional) move to a new line
echo "Grabbing docker-compose and .env file"
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/master/docker-compose.yml \
-o $SEAT_DOCKER_INSTALL/docker-compose.yml
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/master/.env \
-o $SEAT_DOCKER_INSTALL/.env
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/$SEAT_GITHUB_BRANCH/docker-compose.yml -o $SEAT_DOCKER_INSTALL/docker-compose.yml
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/$SEAT_GITHUB_BRANCH/docker-compose.mariadb.yml -o $SEAT_DOCKER_INSTALL/docker-compose.mariadb.yml
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/$SEAT_GITHUB_BRANCH/docker-compose.traefik.yml -o $SEAT_DOCKER_INSTALL/docker-compose.traefik.yml
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/$SEAT_GITHUB_BRANCH/docker-compose.proxy.yml -o $SEAT_DOCKER_INSTALL/docker-compose.proxy.yml
curl -L https://raw.githubusercontent.com/eveseat/seat-docker/$SEAT_GITHUB_BRANCH/.env -o $SEAT_DOCKER_INSTALL/.env

echo "Generating a random database password and writing it to the .env file."
sed -i -- 's/DB_PASSWORD=i_should_be_changed/DB_PASSWORD='$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c22 ; echo '')'/g' .env
Expand Down Expand Up @@ -143,7 +134,7 @@ sed -i -- 's/EVE_CLIENT_SECRET=null/EVE_CLIENT_SECRET='"${CLIENT_SECRET}"'/g' .e

echo # (optional) move to a new line
echo "Starting docker stack. This will download the images too. Please wait..."
docker-compose up -d
docker compose -f docker-compose.yml -f docker-compose.mariadb.yml -f docker-compose.traefik.yml up

echo # (optional) move to a new line
echo "Done! The containers are now initialising. To check what is happening, run 'docker-compose logs --tail 5 -f' in ${SEAT_DOCKER_INSTALL}"
Loading