New versions
This commit is contained in:
+11
-5
@@ -5,8 +5,11 @@
|
||||
pwd_dirname=$(basename $(pwd))
|
||||
script_dirname="faye"
|
||||
arch=$(uname)
|
||||
#1certs_dir="/etc/letsencrypt/live/mozo.bar"
|
||||
certs_dir="/Users/bj/Library/Application Support/mkcert"
|
||||
if [ $arch == "Darwin" ]; then
|
||||
certs_dir="/Users/bj/Library/Application Support/mkcert"
|
||||
else
|
||||
certs_dir="/etc/letsencrypt/live/mozo.bar"
|
||||
fi
|
||||
#certs_dir="/home/benjamin/mozo/mozo-user/ssl"
|
||||
if [ "$pwd_dirname" == "$script_dirname" ]; then
|
||||
echo "PWD DIRNAME: "$pwd_dirname;
|
||||
@@ -17,17 +20,20 @@ fi
|
||||
if [ -d "$certs_dir" ]; then
|
||||
echo "Found certificates directory, copy it to local for inclusion in the docker build"
|
||||
rm -rf $script_dirname/ssl
|
||||
mkdir $script_dirname/ssl
|
||||
# Note the -L option for copy is required, since the target are symbolic links and we want the real files
|
||||
#if [ -f "$certs_dir/localhost-key.pem" ]; then
|
||||
if [ $arch == "Darwin" ]; then
|
||||
echo "Using Darwin localhost certificate copy https://medium.com/@matayoshi.mariano/how-to-add-ssl-to-your-localhost-with-puma-37a66a649f29"
|
||||
mkdir $script_dirname/ssl
|
||||
cp "$certs_dir/localhost-key.pem" $script_dirname/ssl/privkey.pem
|
||||
cp "$certs_dir/localhost.pem" $script_dirname/ssl/fullchain.pem
|
||||
cp "$certs_dir/rootCA-key.pem" $script_dirname/ssl/rootCA-key.pem
|
||||
cp "$certs_dir/rootCA.pem" $script_dirname/ssl/rootCA.pem
|
||||
#cp -r "$certs_dir" "$script_dirname/ssl"
|
||||
else
|
||||
echo "Using letsencrypt folder copy"
|
||||
# copy full directory, assuming letsencrypt
|
||||
cp -rL $certs_dir $script_dirname/ssl
|
||||
cp -rL "$certs_dir" "$script_dirname/ssl"
|
||||
fi
|
||||
else
|
||||
echo "Certs dir not found at: $certs_dir"
|
||||
@@ -48,7 +54,7 @@ docker build -f faye/Dockerfile -t mozo_faye .
|
||||
# 5. Spin up the counter container from the generated image
|
||||
if [ $arch == "Darwin" ]; then
|
||||
echo "Running the created image using the Mac Darwin port exposing"
|
||||
docker run -p 9296:9296 --restart unless-stopped --detach --name=mozo_faye mozo_faye
|
||||
#docker run -p 9296:9296 --restart unless-stopped --detach --name=mozo_faye mozo_faye
|
||||
else
|
||||
echo "Running the created image using network=host"
|
||||
docker run --network=host --restart unless-stopped --detach --name=mozo_faye mozo_faye
|
||||
|
||||
Reference in New Issue
Block a user