From 7164117e2770a7a5a166c121c529349b93132068 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 12 Dec 2024 22:38:49 +0900 Subject: [PATCH] create project --- .gitignore | 1 + Makefile | 18 ++++++++++++++++++ README.md | 33 +++++++++++++++++++++++++++++++++ compose.yml | 41 +++++++++++++++++++++++++++++++++++++++++ deploy | 9 +++++++++ install | 6 ++++++ 6 files changed, 108 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 compose.yml create mode 100755 deploy create mode 100755 install diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23177f2 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +REMOTE_HOST := $(notdir $(shell pwd -L)) + +.PHONY: help +help: + @cat README.md + +.PHONY: install +install: + ssh $(REMOTE_HOST) <$@ + +.PHONY: deploy +deploy: + ssh $(REMOTE_HOST) <$@ + +.env: + touch $@ + chmod 600 $@ + @echo POSTGRES_PASSWORD=$(shell openssl rand -hex 32) >$@ diff --git a/README.md b/README.md new file mode 100644 index 0000000..be92959 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# daraz-tek.beta.fogtype.com + +だらずてっくの Slack のアーカイブ + +Slack のログの移行方法: + +## 構成 + +- Ubuntu 22.04 LTS Server + +## 使用方法 + +### サーバーへのインストール + +``` +make install +``` + +### サーバーにデプロイ + +``` +make deploy +``` + +### 環境変数ファイルの生成 + +``` +make .env +``` + +## ライセンス + +WTFPL diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..ed62bef --- /dev/null +++ b/compose.yml @@ -0,0 +1,41 @@ +name: daraz-tek +services: + mattermost: + image: mattermost/mattermost-team-edition + restart: unless-stopped + security_opt: + - no-new-privileges:true + pids_limit: 200 + tmpfs: + - /tmp + ports: + - "8065:8065" + volumes: + - mattermost_data:/mattermost + environment: + TZ: Asia/Tokyo + MM_LOCALIZATIONSETTINGS_DEFAULTCLIENTLOCALE: ja + MM_BLEVESETTINGS_INDEXDIR: /mattermost/bleve-indexes + MM_SERVICESETTINGS_SITEURL: https://daraz-tek.beta.fogtype.com + MM_SQLSETTINGS_DRIVERNAME: postgres + MM_SQLSETTINGS_DATASOURCE: postgres://postgres:${POSTGRES_PASSWORD:?}@postgres:5432/postgres?sslmode=disable&connect_timeout=10 + MM_TEAMSETTINGS_MAXUSERSPERTEAM: "100" + depends_on: + - postgres + postgres: + image: postgres:17-alpine + restart: unless-stopped + security_opt: + - no-new-privileges:true + pids_limit: 100 + read_only: true + tmpfs: + - /tmp + - /var/run/postgresql + volumes: + - postgres_data_v17:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD +volumes: + mattermost_data: + postgres_data_v17: diff --git a/deploy b/deploy new file mode 100755 index 0000000..ee6b517 --- /dev/null +++ b/deploy @@ -0,0 +1,9 @@ +#!/bin/sh +set -eu + +cd "${HOME}/daraz-tek.beta.fogtype.com" + +git pull --recurse-submodules --rebase --autostash +docker compose up --build --detach + +cd - diff --git a/install b/install new file mode 100755 index 0000000..c172584 --- /dev/null +++ b/install @@ -0,0 +1,6 @@ +#!/bin/sh +set -eu + +sudo apt install -y git make +git clone https://github.com/kou029w/daraz-tek.beta.fogtype.com +make -C daraz-tek.beta.fogtype.com .env