From 2600ad5a059d069aa79c581d83a87b2a5df5fcb2 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 13 Jun 2022 16:40:55 +0000 Subject: [PATCH] Add traefik instance configuration (#781) Signed-off-by: rjshrjndrn --- docker-compose-traefik.yaml | 76 +++++++++++++++++++++++++++++++++++++ letsencrypt/acme.json | 0 2 files changed, 76 insertions(+) create mode 100644 docker-compose-traefik.yaml create mode 100644 letsencrypt/acme.json diff --git a/docker-compose-traefik.yaml b/docker-compose-traefik.yaml new file mode 100644 index 0000000..79b8b6a --- /dev/null +++ b/docker-compose-traefik.yaml @@ -0,0 +1,76 @@ +# cant use mem_limit in a 3.x docker-compose file in non swarm mode +# see https://github.com/docker/compose/issues/4513 +version: "2.4" + +services: + traefik: + image: "traefik:v2.7" + container_name: "traefik" + command: + #- "--log.level=DEBUG" + - "--api.insecure=true" + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.websecure.address=:443" + - "--certificatesresolvers.myresolver.acme.tlschallenge=true" + #- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" + - "--certificatesresolvers.myresolver.acme.email=change@domain.name" + - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" + ports: + - "443:443" + - "8080:8080" + volumes: + - "./letsencrypt:/letsencrypt" + - "/var/run/docker.sock:/var/run/docker.sock:ro" + + whoogle-search: + labels: + - "traefik.enable=true" + - "traefik.http.routers.whoami.rule=Host(`change.host.name`)" + - "traefik.http.routers.whoami.entrypoints=websecure" + - "traefik.http.routers.whoami.tls.certresolver=myresolver" + - "traefik.http.services.whoogle-search.loadbalancer.server.port=5000" + image: ${WHOOGLE_IMAGE:-benbusby/whoogle-search} + container_name: whoogle-search + restart: unless-stopped + pids_limit: 50 + mem_limit: 256mb + memswap_limit: 256mb + # user debian-tor from tor package + user: whoogle + security_opt: + - no-new-privileges + cap_drop: + - ALL + tmpfs: + - /config/:size=10M,uid=927,gid=927,mode=1700 + - /var/lib/tor/:size=15M,uid=927,gid=927,mode=1700 + - /run/tor/:size=1M,uid=927,gid=927,mode=1700 + environment: # Uncomment to configure environment variables + # Basic auth configuration, uncomment to enable + #- WHOOGLE_USER= + #- WHOOGLE_PASS= + # Proxy configuration, uncomment to enable + #- WHOOGLE_PROXY_USER= + #- WHOOGLE_PROXY_PASS= + #- WHOOGLE_PROXY_TYPE= + # Site alternative configurations, uncomment to enable + # Note: If not set, the feature will still be available + # with default values. + #- WHOOGLE_ALT_TW=farside.link/nitter + #- WHOOGLE_ALT_YT=farside.link/invidious + #- WHOOGLE_ALT_IG=farside.link/bibliogram/u + #- WHOOGLE_ALT_RD=farside.link/libreddit + #- WHOOGLE_ALT_MD=farside.link/scribe + #- WHOOGLE_ALT_TL=farside.link/lingva + #- WHOOGLE_ALT_IMG=farside.link/rimgo + #- WHOOGLE_ALT_WIKI=farside.link/wikiless + # - WHOOGLE_CONFIG_DISABLE=1 + # - WHOOGLE_CONFIG_SEARCH_LANGUAGE=lang_en + # - WHOOGLE_CONFIG_GET_ONLY=1 + # - WHOOGLE_CONFIG_COUNTRY=FR + #env_file: # Alternatively, load variables from whoogle.env + #- whoogle.env + ports: + - 8000:5000 diff --git a/letsencrypt/acme.json b/letsencrypt/acme.json new file mode 100644 index 0000000..e69de29