2024-09-29 15:00:19 +02:00
|
|
|
{
|
|
|
|
|
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
|
2025-01-04 20:33:00 +01:00
|
|
|
pkgs.postgresql
|
2024-09-29 15:00:19 +02:00
|
|
|
pkgs.nginx
|
|
|
|
|
pkgs.acme-sh
|
|
|
|
|
pkgs.bash
|
|
|
|
|
pkgs.coreutils
|
|
|
|
|
];
|
|
|
|
|
config = {
|
|
|
|
|
Cmd = [ "${entrypoint}/bin/entrypoint" ];
|
|
|
|
|
ExposedPorts = {
|
|
|
|
|
"80" = { };
|
|
|
|
|
"443" = { };
|
|
|
|
|
};
|
|
|
|
|
Volumes = {
|
|
|
|
|
"/var/lib/postgresql/data" = { };
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|