mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 02:41:35 +01:00
Create template for docker image
This commit is contained in:
@@ -49,6 +49,8 @@
|
||||
dev-vm = self.nixosConfigurations.dev-vm.config.system.build.vm;
|
||||
|
||||
default = pkgs.callPackage ./nix/package.nix { };
|
||||
|
||||
docker = pkgs.callPackage ./nix/docker.nix { };
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
45
nix/docker.nix
Normal file
45
nix/docker.nix
Normal 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" = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -33,6 +33,11 @@ footer {
|
||||
padding-block: var(--space-s);
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-block-start: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.articles ul {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -32,6 +32,11 @@ footer {
|
||||
padding-block: var(--space-s);
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-block-start: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
section {
|
||||
scroll-margin-block-start: var(--space-xl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user