1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00
bitwarden/scripts/start.sh
2017-08-21 11:58:15 -04:00

36 lines
764 B
Bash

#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OUTPUT_DIR="../."
if [ $# -eq 1 ]
then
OUTPUT_DIR=$1
fi
DOCKER_DIR=$DIR/../docker
if [ $# -eq 2 ]
then
DOCKER_DIR=$2
fi
OS="linux"
if [ "$(uname)" == "Darwin" ]
then
OS="macwin"
fi
docker --version
docker-compose --version
LETS_ENCRYPT_PATH = "${outputDir}/letsencrypt"
if [ -d "LETS_ENCRYPT_PATH" ]
then
docker run -it --rm --name certbot -p 443:443 -p 80:80 -v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
renew --logs-dir /etc/letsencrypt/logs
fi
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.$OS.yml down
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.$OS.yml up -d