commit 014559e986b31c7bae8a70435d8fbef8004a32d8 Author: Kris Lamoureux Date: Sat Oct 7 17:50:16 2023 -0400 testing diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1969ad1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright (C) 2023 by Kris Lamoureux + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d6a31d --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Traefik Deployment Repository + +Deployment of Traefik using Docker Compose. + +## Configurable Environment Variables + +### General Service Configuration +- `IMAGE`: The Docker image for Traefik. Default: `traefik`. +- `VERSION`: The version tag of the Docker image. Default: `latest`. +- `NAME`: The name assigned to the running container. Default: `traefik`. +- `VOLUME`: Volume or bind path to the Traefik configuration. Default: `traefik`. + +### Networking +- `NETWORK`: Specifies Traefik's Docker network name. Default: `traefik`. +- `HTTP_PORT`: Map a custom host port to port 80 in the container, formatted as [HOST:]CONTAINER. Default: `80:80`. +- `HTTPS_PORT`: Map a custom host port to port 443 in the container, formatted as [HOST:]CONTAINER. Default: `443:443`. + +### Traefik Labels +- `ROUTER`: Defines the name of the Traefik's own router. Default: `traefik`. +- `DOMAIN`: Set the domain on which Traefik is accessible. Default: `traefik.local.krislamo.org`. +- `ENABLE`: Boolean that indicates whether the dashboard is accessable. Default: `false`. + +### Example .env + +```txt +VERSION=latest +DOMAIN=traefik.local.example.org +ENABLE=false +HTTP_PORT=127.0.0.1:8000:80 +HTTPS_PORT=127.0.0.1:8443:443 +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f1e8955 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.7' + +networks: + ${NETWORK:-traefik}: + name: ${NETWORK:-traefik} + +services: + traefik: + image: "${IMAGE:-traefik}:${VERSION:-latest}" + container_name: "${NAME:-traefik}" + ports: + - "${HTTP_PORT:-80:80}" + - "${HTTPS_PORT:-443:443}" + networks: + - traefik + labels: + - "traefik.http.routers.${ROUTER:-traefik}.rule=Host(`${DOMAIN:-traefik.local.krislamo.org}`)" + - "traefik.http.routers.${ROUTER:-traefik}.service=api@internal" + - "traefik.docker.network=${NETWORK:-traefik}" + - "traefik.enable=${ENABLE:-false}" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - "${VOLUME:-traefik}:/etc/traefik"