From 9c0d56dfd2bc34224bcb012098ff824f5398a23a Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 24 Oct 2022 16:18:04 +0100 Subject: [PATCH] new build scripts --- Dockerfile => Containerfile | 0 build-pleroma.sh | 8 ++++++++ run-pleroma.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) rename Dockerfile => Containerfile (100%) create mode 100755 build-pleroma.sh create mode 100755 run-pleroma.sh diff --git a/Dockerfile b/Containerfile similarity index 100% rename from Dockerfile rename to Containerfile diff --git a/build-pleroma.sh b/build-pleroma.sh new file mode 100755 index 0000000..8130bf2 --- /dev/null +++ b/build-pleroma.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ "$1" == "" ]]; then + echo "No commit ID provided" + exit +fi +dt=$(date +"%Y%m%d") +podman build -f Containerfile --build-arg="PLEROMA_VER=$1" -t pleroma:run-$dt-$1 diff --git a/run-pleroma.sh b/run-pleroma.sh new file mode 100755 index 0000000..227832e --- /dev/null +++ b/run-pleroma.sh @@ -0,0 +1,35 @@ +#!/bin/bash +if [[ $1 == "" ]]; then + echo "No Image tag provided" + exit +fi +echo Creating directories... +mkdir ./postgres +mkdir ./uploads +mkdir ./static +touch config.exs +chown -R 911:911 ./uploads + +echo Stopping old `pleroma-web` container... +podman stop pleroma-web +podman rm pleroma-web + +echo Creating new `pleroma-web` container... +podman run -d \ + --name pleroma-web \ + --pod pleroma-pod \ + -v ./uploads:/var/lib/pleroma/uploads:z \ + -v ./static:/var/lib/pleroma/static:z \ + -v ./config.exs:/etc/pleroma/config.exs:ro \ + -e DOMAIN=social.example.com \ + -e INSTANCE_NAME=Pleroma \ + -e ADMIN_EMAIL=admin@example.com \ + -e NOTIFY_EMAIL=notify@example.com \ + -e DB_USER=pleroma \ + -e DB_PASS=pleroma \ + -e DB_NAME=pleroma \ + -e DB_HOST=localhost \ + -e POSTGRES_HOST=localhost \ + pleroma:$1 + +