feature: Adds base Traefik stack

This commit is contained in:
Tera << 8 2025-05-06 07:48:49 -04:00
parent 8a2f7309ec
commit efe245787a
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
4 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,39 @@
# Auto-generated using compose2nix v0.3.1.
{ pkgs, lib, ... }:
{
# Containers
virtualisation.oci-containers.containers."traefik-reverse-proxy" = {
image = "traefik:v3.3";
volumes = [
"/var/run/docker.sock:/var/run/docker.sock:rw"
];
cmd = [ "--api.insecure=true" "--entryPoints.web.address=:8000" "--providers.docker" ];
log-driver = "journald";
extraOptions = [
"--network=host"
];
};
systemd.services."docker-traefik-reverse-proxy" = {
serviceConfig = {
Restart = lib.mkOverride 90 "no";
};
partOf = [
"docker-compose-traefik-root.target"
];
wantedBy = [
"docker-compose-traefik-root.target"
];
};
# Root service
# When started, this will automatically create all resources and start
# the containers. When stopped, this will teardown all resources.
systemd.targets."docker-compose-traefik-root" = {
unitConfig = {
Description = "Root target generated by compose2nix.";
};
wantedBy = [ "multi-user.target" ];
};
}

View file

@ -0,0 +1,12 @@
version: '3'
services:
reverse-proxy:
# The official v3 Traefik docker image
image: traefik:v3.3
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --entryPoints.web.address=:8000 --providers.docker
network_mode: host
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock