Files
archtika/nix/docker.nix
2024-09-29 15:00:19 +02:00

46 lines
831 B
Nix

{
pkgs,
...
}:
# Behaviour of the Nix module needs to be replicated, which includes PostgreSQL, NGINX, ACME (DNS01), env variables, etc.
# Basic initialisation template can be found below
let
archtika = pkgs.callPackage ./package.nix { };
postgresConf = pkgs.writeText "postgres.conf" ''
'';
nginxConf = pkgs.writeText "nginx.conf" ''
'';
entrypoint = pkgs.writeShellScriptBin "entrypoint" ''
'';
in
pkgs.dockerTools.buildLayeredImage {
name = "archtika";
tag = "latest";
contents = [
archtika
entrypoint
pkgs.postgresql_16
pkgs.nginx
pkgs.acme-sh
pkgs.bash
pkgs.coreutils
];
config = {
Cmd = [ "${entrypoint}/bin/entrypoint" ];
ExposedPorts = {
"80" = { };
"443" = { };
};
Volumes = {
"/var/lib/postgresql/data" = { };
};
};
}