From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1689262145; bh=0j9QFBN86VDyVKHdanOSVs1b26xs0hDcCitVHyGKKCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eN4IVUR0WqFmumFF/xISq4LbNNRhFT4PEKMGZosG5xEmcquOXGxq3gA8WOd56zDqG cBpSieol3slDT3uwjWeQ0vJjQVhnKR/7rnOYM7ZuBjrkcOOzWJ/Vcm2ddvKR66itmL ui7vwe6lhkAU7aoTQJh/pdkuLEpnLGr9Ytqdey9/UeUvfj7vliqtlFshFR74zKvdmH O9p7atT7qnNaD5hVUUymDQfMkU7qxJGFlyP8gtRToSNSRYWPLFB/PkydcXGH/8qUMB D75GvCV9Hj45la5Ldl2fd3c2pskOX7RE6dNJ1WzTmonVdj/xXRVSPxtDVKE8mKC5N/ XanabEaBzUOig== Received: from server-haj002.. (server-haj002.gnuweeb.org [45.83.104.102]) by gnuweeb.org (Postfix) with ESMTPSA id 1243224AC5B; Thu, 13 Jul 2023 22:29:03 +0700 (WIB) From: Alviro Iskandar Setiawan To: Ammar Faizi , Michael William Jonathan Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH server-haj002 v1 5/6] Add elk server using docker Date: Thu, 13 Jul 2023 17:28:49 +0200 Message-Id: <20230713152850.5565-6-alviro.iskandar@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230713152850.5565-1-alviro.iskandar@gnuweeb.org> References: <20230713152850.5565-1-alviro.iskandar@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: elk is a nimble Mastodon web client. Link: https://t.me/GNUWeeb/807595 Cc: Michael William Jonathan Signed-off-by: Alviro Iskandar Setiawan --- elk/.gitignore | 2 ++ elk/docker-compose.yml | 30 ++++++++++++++++++++++++++++++ elk/start.sh | 23 +++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 elk/.gitignore create mode 100644 elk/docker-compose.yml create mode 100644 elk/start.sh diff --git a/elk/.gitignore b/elk/.gitignore new file mode 100644 index 0000000..d7fae55 --- /dev/null +++ b/elk/.gitignore @@ -0,0 +1,2 @@ +/elk_git/ +/elk-storage/ diff --git a/elk/docker-compose.yml b/elk/docker-compose.yml new file mode 100644 index 0000000..0ec1c6f --- /dev/null +++ b/elk/docker-compose.yml @@ -0,0 +1,30 @@ +version: "2.1" + +networks: + elk-net: + enable_ipv6: true + driver: bridge + ipam: + driver: default + config: + - subnet: 10.4.5.0/24 + gateway: 10.4.5.1 + - subnet: fcdd:af::/64 + gateway: fcdd:af::1 + driver_opts: + com.docker.network.bridge.name: elk-net + +services: + elk: + networks: + elk-net: + ipv4_address: 10.4.5.2 + ipv6_address: fcdd:af::2 + build: + context: ./elk_git + dockerfile: Dockerfile + volumes: + # make sure this directory has the same ownership as the elk user from the Dockerfile + # otherwise Elk will not be able to store configs for accounts + # e.q. mkdir ./elk-storage; sudo chown 911:911 ./elk-storage + - './elk-storage:/elk/data' diff --git a/elk/start.sh b/elk/start.sh new file mode 100644 index 0000000..6662d92 --- /dev/null +++ b/elk/start.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# +# For an unknown reason, a git submodule of elk cannot be built +# using docker-compose up --build. This script will clone +# the elk repository and build the docker image if there is +# no available elk instance on the machine. +# + +parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ); + +cd "${parent_path}"; + +if [ ! -f "${parent_path}/elk_git" ]; then + mkdir -pv ./elk-storage; + chown -R 911:911 ./elk-storage; +fi; + +if [ ! -f "${parent_path}/elk_git/Dockerfile" ]; then + git clone https://github.com/elk-zone/elk.git "${parent_path}/elk_git"; +fi; + +docker-compose up --build -d; -- Alviro Iskandar Setiawan