Files
postgrest/nix/docker/default.nix
T

43 lines
821 B
Nix

{ buildEnv
, postgrest
, dockerTools
, checkedShellScript
}:
let
image =
dockerTools.buildImage {
name = "postgrest";
tag = "latest";
contents = postgrest;
# Set the current time as the image creation date. This makes the build
# non-reproducible, but that should not be an issue for us.
created = "now";
extraCommands =
''
rmdir share
'';
config = {
Cmd = [ "/bin/postgrest" ];
User = "1000";
ExposedPorts = {
"3000/tcp" = { };
};
};
};
# Helper script for loading the image.
load =
checkedShellScript "postgrest-docker-load"
''
docker load -i ${image}
'';
in
buildEnv
{
name = "postgrest-docker";
paths = [ load.bin ];
} // { inherit image; }