From 4d3391b1644e87dec2d60d3315401e4db2bbc943 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Sun, 8 Oct 2023 20:34:45 -0400 Subject: [PATCH] testing --- LICENSE | 12 ++++++++++++ README.md | 30 ++++++++++++++++++++++++++++++ docker-compose.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docker-compose.yml 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..b67973a --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# 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`. + +### 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..fc25628 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,41 @@ +version: '3.7' + +volumes: + traefik: + +networks: + traefik: + name: traefik + +services: + traefik: + image: "${IMAGE:-traefik}:${VERSION:-latest}" + container_name: "${NAME:-traefik}" + command: + - --api.dashboard=${DASHBOARD:-true} + - --api.debug=${DEBUG:-false} + - --log.level=${LOG_LEVEL:-ERROR} + - --providers.docker=true + - --providers.docker.exposedbydefault=${EXPOSED_BY_DEFAULT:-false} + - --entrypoints.web.address=:80 + - --entrypoints.websecure.address=:443 + - --entrypoints.local.address=:8443 + - --entrypoints.web.http.redirections.entrypoint.to=websecure + - --entrypoints.web.http.redirections.entrypoint.scheme=https + - --entrypoints.web.http.redirections.entrypoint.permanent=true + ports: + - "${WEB_PORT:-0.0.0.0:80:80}" + - "${WEBSECURE_PORT:-0.0.0.0:443:443}" + - "${LOCAL_PORT:-127.0.0.1:8443:8443}" + labels: + traefik.http.routers.${ROUTER:-traefik}.rule: Host(`${DOMAIN:-traefik.local.krislamo.org}`) + traefik.http.routers.${ROUTER:-traefik}.service: api@internal + traefik.http.routers.${ROUTER:-traefik}.entrypoints: ${ENTRYPOINT:-local} + traefik.http.routers.${ROUTER:-traefik}.tls: true + traefik.docker.network: ${NETWORK:-traefik} + traefik.enable: ${ENABLE:-false} + networks: + - traefik + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - "traefik:/etc/traefik"