From ca8897f9129bdd0f2b75f4d45ba369a8b5011a64 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 14 Nov 2020 10:36:36 -0500 Subject: [PATCH] update docs --- Dockerfile | 6 ++++++ docker/launcher.sh | 29 ++++++++++++++++------------- docker/run_postgresql.sh | 10 ++++------ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0112e598..fee6291f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,12 @@ # # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ # +# Creates a Docker image that runs the Bubble Launcher. You shouldn't have to use this file directly. +# +# For Linux and Mac OS, you can try the easier way, using a prebuilt image from DockerHub: +# +# /bin/bash -c "$(curl -sL https://git.bubblev.org/bubblev/bubble/raw/branch/master/docker/launcher.sh)" +# FROM phusion/baseimage:focal-1.0.0alpha1-amd64 MAINTAINER jonathan@getbubblenow.com LABEL maintainer="jonathan@getbubblenow.com" diff --git a/docker/launcher.sh b/docker/launcher.sh index 1afd3f6f..8c4d61c8 100644 --- a/docker/launcher.sh +++ b/docker/launcher.sh @@ -2,15 +2,14 @@ # # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ # -# Run bubble launcher in a docker container. Intended for non-developers to run via curl | bash: +# Run bubble launcher in a docker container. Works on Linux or Mac OS. # -# Usage: -# -# launcher.sh +# /bin/bash -c "$(curl -sL https://git.bubblev.org/bubblev/bubble/raw/branch/master/docker/launcher.sh)" # # This command will: -# - install docker if not found -# - pull and run bubble docker image +# - install docker if no "docker" command found +# - pull bubble launcher docker image +# - run bubble launcher docker image # function die { @@ -18,12 +17,14 @@ function die { exit 1 } -BUBBLE_META_URL="https://git.bubblev.org/bubblev/bubble/raw/branch/master/bubble-server/src/main/resources/META-INF/bubble/bubble.properties" -VERSION="$(curl -s ${BUBBLE_META_URL} | grep bubble.version | awk -F '=' '{print $2}' | awk -F ' ' '{print $NF}' | awk '{$1=$1};1')" -if [[ -z "${VERSION}" ]] ; then - die "Error determining version from URL: ${BUBBLE_META_URL}" -fi -BUBBLE_TAG="getbubble/launcher:${VERSION}" +function get_bubble_tag() { + BUBBLE_META_URL="https://git.bubblev.org/bubblev/bubble/raw/branch/master/bubble-server/src/main/resources/META-INF/bubble/bubble.properties" + VERSION="$(curl -s ${BUBBLE_META_URL} | grep bubble.version | awk -F '=' '{print $2}' | awk -F ' ' '{print $NF}' | awk '{$1=$1};1')" + if [[ -z "${VERSION}" ]] ; then + die "Error determining version from URL: ${BUBBLE_META_URL}" + fi + echo -n "getbubble/launcher:${VERSION}" +} function setup_docker_linux() { # Ensure apt is up to date @@ -75,12 +76,14 @@ function setup_docker() { fi fi + # Determine bubble docker tag based on meta props bubble version + BUBBLE_TAG=$(get_bubble_tag) + # Pull bubble docker image docker pull ${BUBBLE_TAG} # Run bubble docker image docker run -p 8090:8090 -t ${BUBBLE_TAG} || die "Error running docker container" - } setup_docker diff --git a/docker/run_postgresql.sh b/docker/run_postgresql.sh index 01df51ad..f8f4485e 100755 --- a/docker/run_postgresql.sh +++ b/docker/run_postgresql.sh @@ -1,15 +1,13 @@ #!/bin/sh # # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ +# adapted from https://stackoverflow.com/q/11092358 # - +# This script is run by Supervisor to start PostgreSQL in foreground mode. # -# adapted from https://stackoverflow.com/q/11092358 -# This script is run by Supervisor to start PostgreSQL in foreground mode +# WARNING: If you have more than one PostgreSQL version installed, there could be problems. +# This script assumes you have only one version of PostgreSQL installed. # -# If you have more than one PostgreSQL version installed, there could be problems. -# This script assumes you have only one version installed - if [ -d /var/run/postgresql ]; then chmod 2775 /var/run/postgresql else