Initial commit

This commit is contained in:
Kienan Stewart 2022-09-10 16:23:15 -04:00
commit b49546005e
5 changed files with 84 additions and 0 deletions

21
README.md Normal file
View File

@ -0,0 +1,21 @@
# Traefik Container
## Running in development
```
podman network exists web || podman network create web
podman-compose up -d
```
## Running in production
```
# Create a place to store configuration snippets for the file provider, if one
# does not yet exist. A known external volume is used since podman-compose will prefix
# non-external volumes with the project slug, making it less predictable for
# production deployments.
sudo podman volume exists traefik_config || sudo podman volume create traefik_config
sudo podman-compose up -d
```
It is possible to run this with a systemd service.

0
conf.d/.gitkeep Normal file
View File

10
conf.d/whoami.toml Normal file
View File

@ -0,0 +1,10 @@
[http]
[http.routers]
[http.routers.whoami]
entryPoints = ["http"]
rule = "Host(`whoami.localhost`)"
service = "whoami"
[http.services]
[http.services.whoami.loadBalancer]
[[http.services.whoami.loadBalancer.servers]]
url = "http://whoami/"

View File

@ -0,0 +1,27 @@
---
version: '3'
networks:
web:
external: false
volumes:
certs:
# This is defined as external since configuration management
# software will place necessary configuration snippets there.
traefik_config:
external: true
services:
reverse-proxy:
environment:
- TRAEFIK_API_INSECURE=false
ports:
# The HTTP port
- "80:80"
# TLS
- "443:443"
volumes:
- ./traefik.toml:/traefik.toml:ro
- traefik_config:/traefik.conf.d:ro
- certs:/certs

26
container-compose.yml Normal file
View File

@ -0,0 +1,26 @@
---
version: '3'
networks:
web:
external: true
services:
reverse-proxy:
image: docker.io/traefik:latest
command:
- "--configFile=/traefik.toml"
environment:
- TRAEFIK_API_INSECURE=true
ports:
# The HTTP port
- "8080:80"
# The Web UI (enabled by --api.insecure=true)
- "8081:8080"
# TLS
- "8443:443"
networks:
- web
volumes:
- ./traefik.toml:/traefik.toml:ro
- ./conf.d:/traefik.conf.d:ro