Uhm...
This commit is contained in:
parent
11533d21c6
commit
1c0e9af4b9
@ -12,8 +12,9 @@ let
|
|||||||
mapAttrsToList (var: val: ''${var}="${toString val}"'') envVars;
|
mapAttrsToList (var: val: ''${var}="${toString val}"'') envVars;
|
||||||
in pkgs.writeText "envFile" (concatStringsSep "\n" envLines);
|
in pkgs.writeText "envFile" (concatStringsSep "\n" envLines);
|
||||||
|
|
||||||
makeTeslaMateImage =
|
makeTeslaMateImage = { teslaMateImage, postgresImage, grafanaImage
|
||||||
{ teslaMateImage, postgresImage, grafanaImage, stateDirectory, ... }:
|
, teslaMateEnvFile, postgresEnvFile, grafanaEnvFile, teslaMateUid
|
||||||
|
, postgresUid, grafanaUid, stateDirectory, ... }:
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
project.name = "teslamate";
|
project.name = "teslamate";
|
||||||
services = {
|
services = {
|
||||||
@ -22,6 +23,8 @@ let
|
|||||||
restart = "always";
|
restart = "always";
|
||||||
volumes = [ "${stateDirectory}/import:/opt/app/import" ];
|
volumes = [ "${stateDirectory}/import:/opt/app/import" ];
|
||||||
ports = [ "4000:4000" ];
|
ports = [ "4000:4000" ];
|
||||||
|
user = [ "${teslaMateUid}:${teslaMateUid}" ];
|
||||||
|
env_file = [ teslaMateEnvFile ];
|
||||||
cap_drop = "all";
|
cap_drop = "all";
|
||||||
};
|
};
|
||||||
postgres = {
|
postgres = {
|
||||||
@ -29,12 +32,14 @@ let
|
|||||||
restart = "always";
|
restart = "always";
|
||||||
volumes = [ "${stateDirectory}/postgres:/var/lib/postgresql/data" ];
|
volumes = [ "${stateDirectory}/postgres:/var/lib/postgresql/data" ];
|
||||||
env_file = [ postgresEnvFile ];
|
env_file = [ postgresEnvFile ];
|
||||||
|
user = [ "${postgresUid}:${postgresUid}" ];
|
||||||
};
|
};
|
||||||
grafana = {
|
grafana = {
|
||||||
image = grafanaImage;
|
image = grafanaImage;
|
||||||
restart = "always";
|
restart = "always";
|
||||||
volumes = [ "${stateDirectory}/grafana:/var/lib/grafana" ];
|
volumes = [ "${stateDirectory}/grafana:/var/lib/grafana" ];
|
||||||
env_file = [ grafanaEnvFile ];
|
env_file = [ grafanaEnvFile ];
|
||||||
|
user = [ "${grafanaUid}:${grafanaUid}" ];
|
||||||
ports = [ "3000:3000" ];
|
ports = [ "3000:3000" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user