Create template for docker image

This commit is contained in:
thiloho
2024-09-29 15:00:19 +02:00
parent 6c9b42369f
commit 6c314970bd
4 changed files with 57 additions and 0 deletions

View File

@@ -49,6 +49,8 @@
dev-vm = self.nixosConfigurations.dev-vm.config.system.build.vm; dev-vm = self.nixosConfigurations.dev-vm.config.system.build.vm;
default = pkgs.callPackage ./nix/package.nix { }; default = pkgs.callPackage ./nix/package.nix { };
docker = pkgs.callPackage ./nix/docker.nix { };
} }
); );

45
nix/docker.nix Normal file
View File

@@ -0,0 +1,45 @@
{
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" = { };
};
};
}

View File

@@ -33,6 +33,11 @@ footer {
padding-block: var(--space-s); padding-block: var(--space-s);
} }
footer {
margin-block-start: auto;
text-align: center;
}
.articles ul { .articles ul {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -32,6 +32,11 @@ footer {
padding-block: var(--space-s); padding-block: var(--space-s);
} }
footer {
margin-block-start: auto;
text-align: center;
}
section { section {
scroll-margin-block-start: var(--space-xl); scroll-margin-block-start: var(--space-xl);
} }