katzen-cafe/modules/containers/calckey.nix

51 lines
1.5 KiB
Nix
Raw Normal View History

2023-05-06 03:19:19 +02:00
{ 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";
2023-05-06 03:19:19 +02:00
container_name = "calckey_web";
restart = "unless-stopped";
depends_on = [ "db" "redis" ];
ports = [ "3000:3000" ];
networks = [ "calcnet" ];
environment = {
"NODE_ENV" = "production";
};
volumes = [
2023-07-30 16:24:46 +02:00
"/calckey/files:/iceshrimp/files"
"/calckey/config:/iceshrimp/.config:ro"
2023-05-06 03:19:19 +02:00
];
};
"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"
];
};
};
};
};
}