Compare commits

..

No commits in common. "58f2ea9b74731144f1f375419ad1b7f43980cfec" and "2a392b058199df73af10f603eea6ad2a13ecb712" have entirely different histories.

3 changed files with 47 additions and 89 deletions

View file

@ -11,7 +11,6 @@
};
traefik.enable = true;
plex.enable = true;
solidtime.enable = true;
};
virtualisation.guest.enable = true;
};

View file

@ -9,7 +9,6 @@
./homepage
./jellyfin
./plex
./solidtime
./speedtest
./technitium-dns
./traefik

View file

@ -5,8 +5,10 @@ let
networkName = "solidtime";
internalNetworkName = "solidtime-internal";
proxyNet = config.homelab.apps.traefiik.sharedNetworkName;
version = "0.8.0";
port = 8000;
user = "1000:1000";
# dbExternalPort = ...;
@ -16,16 +18,6 @@ let
inherit (config.virtualisation.oci-containers) containers;
solidtimeImageName = "solidtime/solidtime";
version = "0.10.0";
solidtimeImage = "${solidtimeImageName}:${version}";
solidtimeImageFile = pkgs.dockerTools.pullImage {
imageName = solidtimeImageName;
finalImageTag = version;
imageDigest = "sha256:817d3a366ecc39f0473d7154372afa82dd4e6e50c66d70be45804892c8421cbb";
sha256 = "sha256-h5aCKaquUF/EVsOHaLOHrn1HAoXZYPhAbJ+e4cmjSA8=";
};
volumes = [
"solidtime-storage:/var/www/html/storage"
"solidtime-logs:/var/www/html/storage/logs"
@ -38,7 +30,7 @@ let
VITE_APP_NAME = laravelEnv.APP_NAME;
APP_ENV = "production";
APP_DEBUG = "false";
APP_URL = "http://localhost:${toString cfg.port}";
APP_URL = "http://localhost:${toString port}";
APP_FORCE_HTTPS = "false";
APP_ENABLE_REGISTRATION = "false";
TRUSTED_PROXIES = "0.0.0.0/0,2000:0:0:0:0:0:0:0/3";
@ -78,15 +70,7 @@ let
};
in {
options.homelab.apps.solidtime = {
enable = lib.mkEnableOption "Solidtime time tracker using Docker";
port = lib.mkOption {
type = lib.types.int;
default = 8000;
description = "Solidtime WebUI port";
};
exposePort = lib.mkEnableOption "Expose Soldtime port";
};
options.homelab.apps.solidtime.enable = lib.mkEnableOption "Solidtime time tracker using Docker";
config = lib.mkIf cfg.enable {
homelab.virtualisation.containers.enable = true;
@ -132,57 +116,53 @@ in {
virtualisation.oci-containers.containers = {
solidtime = {
hostname = "solidtime";
image = solidtimeImage;
imageFile = solidtimeImageFile;
inherit user;
image = "solidtime/solidtime:${version}";
autoStart = true;
inherit user;
ports = [
# Open ports if you don't use Traefik
"${toString port}:8000"
];
extraOptions = [
"--network=${networkName}"
"--network=${internalNetworkName}"
# Healthecks
# test: [ "CMD-SHELL", "curl --fail http://localhost:8000/health-check/up || exit 1" ]
''--health-cmd=curl --fail http://localhost:8000/health-check/up || exit 1''
];
inherit volumes;
dependsOn = [
"solidtimeDb"
];
ports = [
# Open ports if you don't use Traefik
"${toString cfg.port}:8000"
];
networks = [
networkName
internalNetworkName
];
extraOptions = [
# Healthecks
# test: [ "CMD", "curl", "--fail", "http://localhost:8000/health-check/up" ]
''--health-cmd=curl --fail http://localhost:8000/health-check/up''
];
inherit volumes;
labels = {
"traefik.enable" = "true";
"traefik.http.routers.solidtime.rule" = "Host(`time.${config.networking.hostName}.depeuter.dev`)";
"traefik.http.services.solidtime.loadbalancer.server.port" = toString cfg.port;
};
environmentFiles = [
"/home/admin/.solidtime.env"
];
environment = laravelEnv // {
CONTAINER_MODE = "http";
};
labels = {
"traefik.enable" = "true";
"traefik.http.routers.solidtime.rule" = "Host(`time.${config.networking.hostName}.depeuter.dev`)";
"traefik.http.services.solidtime.loadbalancer.server.port" = toString port;
};
};
solidtimeScheduler = {
hostname = "scheduler";
image = solidtimeImage;
imageFile = solidtimeImageFile;
image = "solidtime/solidtime:${version}";
inherit user;
autoStart = true;
extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks
# test: [ "CMD-SHELL", "supervisorctl status scheduler:scheduler_00" ]
''--health-cmd="supervisorctl status scheduler:scheduler_00"''
];
inherit volumes;
dependsOn = [
"solidtimeDb"
];
networks = [
internalNetworkName
];
extraOptions = [
# Healthchecks
# test: [ "CMD", "healthcheck" ]
''--health-cmd="healthcheck"''
];
inherit volumes;
environmentFiles = [
"/home/admin/.solidtime.env"
];
@ -192,17 +172,15 @@ in {
};
solidtimeQueue = {
hostname = "queue";
image = solidtimeImage;
imageFile = solidtimeImageFile;
image = "solidtime/solidtime:${version}";
inherit user;
autoStart = true;
networks = [
internalNetworkName
];
extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks
# test: [ "CMD", "healthcheck" ]
''--health-cmd="healthcheck"''
# test: [ "CMD-SHELL", "supervisorctl status worker:worker_00" ]
''--health-cmd="supervisorctl status worker:worker_00"''
];
inherit volumes;
dependsOn = [
@ -216,25 +194,16 @@ in {
WORKER_COMMAND = "php /var/www/html/artisan queue:work";
};
};
solidtimeDb = let
imageName = "postgres";
finalImageTag = "15";
in {
solidtimeDb = {
hostname = "database";
image = "${imageName}:${finalImageTag}";
imageFile = pkgs.dockerTools.pullImage {
inherit imageName finalImageTag;
imageDigest = "sha256:98fe06b500b5eb29e45bf8c073eb0ca399790ce17b1d586448edc4203627d342";
sha256 = "sha256-AZ4VkOlROX+nR/MjDjsA4xdHzmtKjiBAtsp2Q6IdOvg=";
};
image = "postgres:15";
autoStart = true;
ports = [
# "${toString dbExternalPort}:${toString dbInternalPort}"
];
networks = [
internalNetworkName
];
extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks
# test: - CMD - pg_isready - '-q' - '-d' - '${DB_DATABASE}' - '-U' - '${DB_USERNAME}' retries: 3 timeout: 5s
''--health-cmd="pg_isready -q -d ${laravelEnv.DB_DATABASE} -U ${laravelEnv.DB_USERNAME}"''
@ -251,22 +220,13 @@ in {
POSTGRES_PASSWORD = laravelEnv.DB_PASSWORD;
};
};
solidtimeGotenberg = let
imageName = "gotenberg/gotenberg";
finalImageTag = "8.26.0";
in {
solidtimeGotenberg = {
hostname = "gotenberg";
image = "${imageName}:${finalImageTag}";
imageFile = pkgs.dockerTools.pullImage {
inherit imageName finalImageTag;
imageDigest = "sha256:328551506b3dec3ff6381dd47e5cd72a44def97506908269e201a8fbfa1c12c0";
sha256 = "sha256-1zz4xDAgXxHUnkCVIfjHTgXb82EFEx+5am6Cu9+eZj4=";
};
image = "gotenberg/gotenberg:8";
autoStart = true;
networks = [
internalNetworkName
];
extraOptions = [
"--network=${internalNetworkName}"
# Healthchecks
# test: [ "CMD", "curl", "--silent", "--fail", "http://localhost:3000/health" ]
''--health-cmd="curl --silent --fail http://localhost:${toString gotenbergPort}/health"''