#!/bin/bash set -e SCRIPTPATH=$(cd "$(dirname "$0")" > /dev/null; pwd -P) SOURCE_DIR=$(cd "$SCRIPTPATH" > /dev/null; cd ../.. > /dev/null; pwd -P) DATA_DIR="$SOURCE_DIR/data/postgres" show_help() { cat <& 2 show_help >& 2 exit 1 ;; esac shift done echo "Using source in: ${SOURCE_DIR}" echo "Using data in: ${DATA_DIR}" mkdir -p "${DATA_DIR}" # 1080 mailcatcher # 3000 puma... if you must (but unicorn is preferred) # 9292 unicorn # 9405 prometheus exporter docker run -d -p 9405:9405 -p 1080:1080 -p 3000:3000 -p 9292:9292 -v "$DATA_DIR:/shared/postgres_data:delegated" -v "$SOURCE_DIR:/src:delegated" $ENV_ARGS --hostname=discourse --name=discourse_dev --restart=always discourse/discourse_dev:release /sbin/boot if [ "${initialize}" = "initialize" ]; then echo "Installing gems..." "${SCRIPTPATH}/bundle" install echo "Migrating database..." "${SCRIPTPATH}/rake" db:migrate RAILS_ENV=test "${SCRIPTPATH}/rake" db:migrate echo "Creating admin user..." "${SCRIPTPATH}/rake" admin:create fi