diff --git a/configuration.nix b/configuration.nix index 2b79b12..cf7beb7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -82,6 +82,54 @@ qemuGuest.enable = true; }; + virtualisation = { + docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + oci-containers.containers = { + db_recipes = { + image = "postgres:16-alpine"; + environmentFiles = [ + /root/tandoor/.env + ]; + volumes = [ + "/root/tandoor/postgresql:/var/lib/postgresql/data" + ]; + }; + web_recipes = { + image = "vabene1111/recipes"; + environmentFiles = [ + /root/tandoor/.env + ]; + volumes = [ + "staticfiles:/opt/recipes/staticfiles" + "nginx_config:/opt/recipes/nginx/conf.d" + "/root/tandoor/mediafiles:/opt/recipes/mediafiles" + ]; + dependsOn = [ "db_recipes" ]; + }; + nginx_recipes = { + image = "nginx:mainline-alpine"; + ports = [ + "8080:80" + ]; + environmentFiles = [ + /root/tandoor/.env + ]; + volumes [ + "nginx_config:/etc/nginx/conf.d:ro" + "staticfiles:/static:ro" + "/root/tandoor/mediafiles:/media:ro" + ]; + dependsOn = [ "web_recipes" ]; + }; + }; + }; + systemd = { timers."start-runner" = { wantedBy = [ "timers.target" ];