Disable frontend and test portainer with traefik

This commit is contained in:
Jean Froment 2018-06-19 15:37:29 +02:00
parent 8b2d20e257
commit 71cc848b72
7 changed files with 121 additions and 13 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/config
tunnel-options.sh
traefik/traefik.env

View File

@ -6,3 +6,5 @@ MYSQL_ROOT_PASSWORD=h4ckMePleAse
# For Plex Pass download only
PLEX_EMAIL=
PLEX_PASSWORD=
PORTAINER_ADMIN_PASSWORD=h4ckMePleAse

View File

@ -14,19 +14,19 @@ volumes:
mountpoint: /data/torrents
services:
frontend:
image: fromenje/seedbox:frontend
build: Dockerfiles/frontend
restart: always
networks:
- main
ports:
- "80:80"
- "443:443"
volumes:
- config:/config
env_file:
- config
# frontend:
# image: fromenje/seedbox:frontend
# build: Dockerfiles/frontend
# restart: always
# networks:
# - main
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - config:/config
# env_file:
# - config
deluge:
image: fromenje/seedbox:deluge
@ -115,3 +115,18 @@ services:
- PGID=33
- PUID=33
- TZ=Europe/Paris
portainer:
image: portainer/portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- web
env_file:
- config
- traefik/traefik.env
command: --admin-password ${PORTAINER_ADMIN_PASSWORD} --host=unix:///var/run/docker.sock
labels:
- 'traefik.backend=portainer'
- 'traefik.port=9000'
- 'traefik.frontend.rule=Host:portainer.${TRAEFIK_DOMAIN}'

3
traefik/init-traefik.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
touch /opt/traefik/acme.json && chmod 600 /opt/traefik/acme.json

View File

@ -0,0 +1,2 @@
ACME_MAIL=my-email@my-provider.com
TRAEFIK_DOMAIN=mydomain.com

61
traefik/traefik.toml Normal file
View File

@ -0,0 +1,61 @@
#https://docs.traefik.io/toml/
#https://docs.traefik.io/user-guide/examples/
################################################################
# Global configuration
################################################################
logLevel = "WARNING"
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
# [acme]
# email = "email@company.com"
# storage = "acme.json"
# onDemande = true
# caServer = "https://acme-v02.api.letsencrypt.org/directory"
# entryPoint = "https"
# [acme.httpChallenge]
# entryPoint = "http"
# [[acme.domains]]
# main = "sub.domain.com"
# sans = ["sub.domain.com", "sub2.domain.com"]
[acme]
email = "overriden@in-traefik.yml"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
acmeLogging = true
[acme.httpChallenge]
entryPoint = "http"
################################################################
# Web configuration backend
################################################################
[web]
address = ":8080"
################################################################
# Traefik Config
################################################################
################################################################
# Docker configuration backend
################################################################
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedByDefault = false
[file]
watch = true

24
traefik/traefik.yml Normal file
View File

@ -0,0 +1,24 @@
version: '2'
services:
traefik:
image: traefik
container_name: traefik
restart: always
env_file:
- ./traefik.env
networks:
- webgateway
command: --acme.email=${ACME_MAIL} --docker.domain=${TRAEFIK_DOMAIN}
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
networks:
webgateway:
driver: bridge