Add traefik example
This commit is contained in:
parent
9a523b45d7
commit
ee2f71327d
2 changed files with 34 additions and 0 deletions
28
examples/traefik/arion-compose.nix
Normal file
28
examples/traefik/arion-compose.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }: {
|
||||
|
||||
config.services = {
|
||||
traefik.service = {
|
||||
image = "traefik:v2.4";
|
||||
container_name = "traefik";
|
||||
command = [
|
||||
"--api.insecure=true"
|
||||
"--providers.docker=true"
|
||||
"--providers.docker.exposedbydefault=false"
|
||||
"--entrypoints.web.address=:80"
|
||||
];
|
||||
ports = [ "80:80" "8080:8080" ];
|
||||
volumes = [ "/var/run/docker.sock:/var/run/docker.sock:ro" ];
|
||||
};
|
||||
|
||||
whoami.service = {
|
||||
image = "traefik/whoami";
|
||||
container_name = "simple-service";
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.whoami.rule" = "Host(`whoami.localhost`)";
|
||||
"traefik.http.routers.whoami.entrypoints" = "web";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
6
examples/traefik/arion-pkgs.nix
Normal file
6
examples/traefik/arion-pkgs.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Instead of pinning Nixpkgs, we can opt to use the one in NIX_PATH
|
||||
import <nixpkgs> {
|
||||
# We specify the architecture explicitly. Use a Linux remote builder when
|
||||
# calling arion from other platforms.
|
||||
system = "x86_64-linux";
|
||||
}
|
Loading…
Reference in a new issue