katzen-cafe/modules/containers/calckey.nix
2023-07-30 16:24:46 +02:00

51 lines
1.5 KiB
Nix

{ pkgs, inputs, ... }:
{
imports = [ inputs.arion.nixosModules.arion ];
virtualisation.docker.enable = true;
virtualisation.arion = {
backend = "docker";
projects.calckey.settings = {
networks.calcnet.name = "calcnet";
services = {
"web".service = {
image = "iceshrimp.dev/iceshrimp/iceshrimp:latest-arm";
container_name = "calckey_web";
restart = "unless-stopped";
depends_on = [ "db" "redis" ];
ports = [ "3000:3000" ];
networks = [ "calcnet" ];
environment = {
"NODE_ENV" = "production";
};
volumes = [
"/calckey/files:/iceshrimp/files"
"/calckey/config:/iceshrimp/.config:ro"
];
};
"redis".service = {
image = "docker.io/redis:7.0-alpine";
container_name = "calckey_redis";
restart = "unless-stopped";
networks = [ "calcnet" ];
volumes = [ "/calckey/redis:/data" ];
};
"db".service = {
image = "docker.io/postgres:12.2-alpine";
container_name = "calckey_db";
restart = "unless-stopped";
networks = [ "calcnet" ];
environment = {
POSTGRES_PASSWORD = "calckey";
POSTGRES_USER = "calckey";
POSTGRES_DB = "calckey";
};
volumes = [
"/calckey/db:/var/lib/postgresql/data"
];
};
};
};
};
}