Files
2023-03-27 12:29:39 +02:00

66 lines
2.3 KiB
YAML

version: "3.9"
services:
ipfs:
restart: unless-stopped
image: lscr.io/linuxserver/ipfs
environment:
PUID: 1000
PGID: 1000
TZ: Europe/Paris
volumes:
- ipfs:/config
- /srv/:/srv
networks:
- caddy
ports:
# - 80:80 #dumb http client
# - 443:443 #optional
- 4001:4001
- 5001:5001
- 8080:8080
deploy:
resources:
limits:
cpus: '0.1'
memory: 500M
# reservations:
# cpus: '0.1'
# memory: 100M
labels:
traefik.enable: "true"
# traefik.http.routers.ipfs.rule: Host(`ipfs.marcpartensky.com`)
traefik.http.routers.ipfs.rule: Host(`ipfs.marcpartensky.fr`)
# traefik.http.routers.ipfs.rule: >
# Host(`ipfs.marcpartensky.com`) || Host(`ipfs.marcpartensky.fr`)
# traefik.http.routers.ipfs.entrypoints: websecure
# traefik.http.routers.ipfs.tls.certresolver: tls
traefik.http.routers.ipfs.tls.certresolver: cloudflare
traefik.http.services.ipfs.loadbalancer.server.port: 5001
traefik.http.routers.ifps.middlewares: ldap_auth
# traefik.frontend.redirect.regex: ^https://ipfs.marcpartensky.com$$
# the middleware 'add-context' must be defined so that the regex rules can be attached to it
# traefik.http.routers.ifps.middlewares: add-context
#
# # here is the logic provided by gustavomtborges of this gist:
# traefik.http.middlewares.add-context.redirectregex.regex: ^https:\\/\\/([^\\/]+)\\/?$$
# traefik.http.middlewares.add-context.redirectregex.replacement: https://$$1/webui
#
traefik.http.routers.ipfs.middlewares: custom_repath
traefik.http.middlewares.custom_repath.replacepathregex.regex: ^/$$
traefik.http.middlewares.custom_repath.replacepathregex.replacement: /webui
# the middleware 'add-context' must be defined so that the regex rules can be attached to it
traefik.http.routers.ipfs.middlewares: add-context
# here is the logic provided by gustavomtborges of this gist:
traefik.http.middlewares.add-context.redirectregex.regex: ^https:\\/\\/([^\\/]+)\\/?$$
traefik.http.middlewares.add-context.redirectregex.replacement: https://$$1/webui
volumes:
ipfs:
networks:
caddy:
external: true