Files
postgrest/nix/docker/default.nix
T

46 lines
868 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" = { };
};
};
};
load =
checkedShellScript
{
name = "postgrest-docker-load";
docs = "Load the PostgREST image into Docker.";
}
''
docker load -i ${image}
'';
in
buildEnv
{
name = "postgrest-docker";
paths = [ load.bin ];
} // { inherit image; }