From 394fdb2ce152b1854293de1e1b307055c3b8d506 Mon Sep 17 00:00:00 2001 From: Lancelot Date: Mon, 23 Dec 2024 22:14:35 +0100 Subject: [PATCH] Add dynamic compose for haven (#6113) --- apps/haven/config.json | 5 +-- apps/haven/docker-compose.json | 57 ++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 apps/haven/docker-compose.json diff --git a/apps/haven/config.json b/apps/haven/config.json index 85e2dbdf65..e1f0906e2e 100644 --- a/apps/haven/config.json +++ b/apps/haven/config.json @@ -3,9 +3,10 @@ "name": "Haven", "available": true, "exposable": true, + "dynamic_config": true, "port": 8130, "id": "haven", - "tipi_version": 3, + "tipi_version": 4, "version": "latest", "categories": ["social"], "description": "Haven is a private blog application built with Ruby on Rails. Write what you want, create accounts for people you want to share with, keep up with each other using built-in RSS.", @@ -35,5 +36,5 @@ ], "supported_architectures": ["amd64", "arm64"], "created_at": 1691943801422, - "updated_at": 1723566284000 + "updated_at": 1734908295125 } diff --git a/apps/haven/docker-compose.json b/apps/haven/docker-compose.json new file mode 100644 index 0000000000..5999d4fb5c --- /dev/null +++ b/apps/haven/docker-compose.json @@ -0,0 +1,57 @@ +{ + "services": [ + { + "name": "haven", + "image": "ghcr.io/havenweb/haven:latest", + "isMain": true, + "internalPort": 3000, + "environment": { + "RAILS_ENV": "production", + "HAVEN_DB_HOST": "haven-db", + "HAVEN_DB_NAME": "haven", + "HAVEN_DB_ROLE": "haven", + "HAVEN_DB_PASSWORD": "${HAVEN_DB_PASSWORD}", + "HAVEN_USER_EMAIL": "${HAVEN_USER_EMAIL}", + "HAVEN_USER_PASS": "${HAVEN_USER_PASSWORD}" + }, + "dependsOn": ["haven-db"], + "volumes": [ + { + "hostPath": "${APP_DATA_DIR}/data/storage", + "containerPath": "/storage" + } + ] + }, + { + "name": "haven-db", + "image": "postgres:13.2-alpine", + "environment": { + "POSTGRES_HOST_AUTH_METHOD": "trust", + "POSTGRES_USER": "haven" + }, + "volumes": [ + { + "hostPath": "${APP_DATA_DIR}/data/db", + "containerPath": "/var/lib/postgresql/data" + } + ], + "command": [ + "postgres", + "-c", + "max_connections=1000", + "-c", + "synchronous_commit=off", + "-c", + "fsync=off", + "-c", + "full_page_writes=off", + "-c", + "max_wal_size=4GB", + "-c", + "checkpoint_timeout=30min", + "-c", + "wal_level=logical" + ] + } + ] +}