This commit is contained in:
Kris Lamoureux 2023-10-08 19:59:35 -04:00
commit d60e365fa3
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 83 additions and 0 deletions

12
LICENSE Normal file
View File

@ -0,0 +1,12 @@
Copyright (C) 2023 by Kris Lamoureux <kris@lamoureux.io>
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.

30
README.md Normal file
View File

@ -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
```

41
docker-compose.yml Normal file
View File

@ -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:-80:80}"
- "${WEBSECURE_PORT:-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"