Files
system-config/system/hosts/mcp/containers/goatcounter.nix

25 lines
871 B
Nix

{ config, ... }:
let
inherit (import ./lib.nix config) mkContainer terakoda hostRule;
in
{
virtualisation.oci-containers.containers.goatcounter = mkContainer {
image = "arp242/goatcounter";
hostName = "goatcounter";
domain = terakoda;
public = true;
port = 8080;
volumes = [
"goatcounter-data:/home/goatcounter/goatcounter-data"
];
extraLabels = {
# "traefik.http.middlewares.strip-analytics.stripprefix.prefixes" = "/analytics";
# "traefik.http.routers.www-terakoda-com-goatcounter.middlewares" = "strip-analytics";
# Host the script on www.terakoda.com so that it is easy to fetch
"traefik.http.routers.www-terakoda-com-goatcounter.rule" =
"PathPrefix(`/count`) && ${hostRule "www" terakoda}";
"traefik.http.routers.www-terakoda-com-goatcounter.service" = "goatcounter";
};
};
}