mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
Use docker instead of nspawn to host onlyoffice
This commit is contained in:
parent
982dc99e7a
commit
18bbe1fd27
5 changed files with 53 additions and 61 deletions
48
hosts/stratus/containers/docker/onlyoffice/default.nix
Normal file
48
hosts/stratus/containers/docker/onlyoffice/default.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
sops.secrets = {
|
||||
"container/onlyoffice/tailscale-auth-key" = { };
|
||||
"container/onlyoffice/jwt-secret" = { };
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
onlyoffice = {
|
||||
image = "onlyoffice/documentserver";
|
||||
environmentFiles = [
|
||||
# Contains "JWT_SECRET=<token>"
|
||||
config.sops.secrets."container/onlyoffice/jwt-secret".path
|
||||
];
|
||||
};
|
||||
|
||||
tailscale-onlyoffice =
|
||||
let
|
||||
configPath = pkgs.writeTextFile {
|
||||
name = "config";
|
||||
destination = "/tailscale-serve.json";
|
||||
text = builtins.toJSON {
|
||||
TCP."443".HTTPS = true;
|
||||
Web."onlyoffice.${config.networking.domain}:443".Handlers."/".Proxy = "http://127.0.0.1:80";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
image = "ghcr.io/tailscale/tailscale:latest";
|
||||
environment = {
|
||||
TS_HOSTNAME = "onlyoffice";
|
||||
TS_STATE_DIR = "/var/lib/tailscale";
|
||||
TS_SERVE_CONFIG = "/config/tailscale-serve.json";
|
||||
TS_USERSPACE = "true"; # https://github.com/tailscale/tailscale/issues/11372
|
||||
};
|
||||
environmentFiles = [
|
||||
# Contains "TS_AUTHKEY=<token>"
|
||||
config.sops.secrets."container/onlyoffice/tailscale-auth-key".path
|
||||
];
|
||||
volumes = [
|
||||
"/var/lib/tailscale-onlyoffice:/var/lib/tailscale"
|
||||
"${configPath}:/config"
|
||||
];
|
||||
extraOptions = [ "--network=container:onlyoffice" ];
|
||||
dependsOn = [ "onlyoffice" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue