Add OpenProject service to tent with docker

This commit is contained in:
2026-02-12 16:51:01 +01:00
parent 8dab0d82ba
commit 41a1f8e17e
3 changed files with 62 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
./nix-serve.nix
./gitlab-runner.nix
./gitea.nix
./openproject.nix
../hut/public-inbox.nix
../hut/msmtp.nix
../module/p.nix

View File

@@ -52,6 +52,16 @@ in
proxy_pass http://127.0.0.1:8081;
proxy_redirect http:// $scheme://;
}
location /op {
proxy_pass http://127.0.0.1:8080;
proxy_pass_header Server;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass_request_headers on;
}
location /grafana {
proxy_pass http://127.0.0.1:2342;
proxy_redirect http:// $scheme://;

51
m/tent/openproject.nix Normal file
View File

@@ -0,0 +1,51 @@
{ pkgs, ... }:
let
dataDir = "/var/lib/openproject/assets";
in
{
# TODO: Create a new user and group to run openproject
# Ensure directory exists
systemd.tmpfiles.rules = [
"d ${dataDir} 777 root root"
];
systemd.services.openproject = let
openprojectSrc = pkgs.fetchFromGitHub {
owner = "opf";
repo = "openproject-docker-compose";
rev = "b66694f26020a205fbefd697530fee287d1ddea2"; # branch stable/17
sha256 = "sha256-m23vM0NyaTA54sjAHlFJ8mOhOjqp9CAciLx4UxzFfHI=";
};
envFile = pkgs.writeText ".env" ''
# https://www.openproject.org/docs/installation-and-operations/configuration/environment/
TAG=17-slim
OPENPROJECT_HTTPS=true
SECRET_KEY_BASE=OVERWRITE_ME
OPENPROJECT_HOST__NAME=jungle.bsc.es
PORT=127.0.0.1:8080
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=/op
IMAP_ENABLED=false
DATABASE_URL=postgres://postgres:p4ssw0rd@db/openproject?pool=20&encoding=unicode&reconnect=true
RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16
PGDATA="/var/lib/postgresql/data"
OPDATA="${dataDir}"
COLLABORATIVE_SERVER_URL=ws://localhost:8080/hocuspocus
COLLABORATIVE_SERVER_SECRET=secret12345
'';
in {
# Needs docker-compose package
path = with pkgs; [ docker-compose ];
script = ''
docker-compose \
-p openproject \
-f ${openprojectSrc}/docker-compose.yml \
--env-file ${envFile} \
up --build --pull always
'';
wantedBy = [ "multi-user.target" ];
after = [ "docker.service" "docker.socket" ];
};
}