From 9398a1b8167f3f9aa15b50f8069625375e0eb764 Mon Sep 17 00:00:00 2001 From: sn0w Date: Fri, 4 Sep 2020 23:18:07 +0200 Subject: [PATCH] Create persistent emoji mount (Fixes #8) --- .dockerignore | 1 + .gitignore | 1 + docker-compose.yml | 1 + pleroma.sh | 9 +++++++++ 4 files changed, 12 insertions(+) diff --git a/.dockerignore b/.dockerignore index b981dcf..14aaf28 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ data/ cache/ +emoji/ diff --git a/.gitignore b/.gitignore index e797e62..87b0cc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ data/ cache/ +emoji/ custom.d/ !custom.d/.gitkeep config.exs diff --git a/docker-compose.yml b/docker-compose.yml index 3b8348a..6d8ee3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,4 +46,5 @@ services: - ./custom.d:/custom.d:ro - ./config.exs:/home/pleroma/pleroma/config/prod.secret.exs:ro - ./config.exs:/home/pleroma/pleroma/config/dev.secret.exs:ro + - ./emoji:/home/pleroma/pleroma/instance/static/emoji - $DOCKER_DATADIR/uploads:/uploads diff --git a/pleroma.sh b/pleroma.sh index 3c9fad8..c41888f 100755 --- a/pleroma.sh +++ b/pleroma.sh @@ -196,6 +196,15 @@ action__restart() { } action__start() { + if [[ ! -d ./data/uploads ]] || [[ ! -d ./emoji ]]; then + if [[ "$(id -u)" != "$DOCKER_UID" ]]; then + echo "Please create the folders ./data/uploads and ./emoji, and chown them to $DOCKER_UID" + exit 1 + fi + + mkdir -p ./data/uploads ./emoji + fi + docker_compose up --remove-orphans -d }