Skip to content

Instantly share code, notes, and snippets.

@vadviktor
Created July 18, 2022 18:58
Show Gist options
  • Save vadviktor/7bdf9068ee392e0639442e9816fb2f7d to your computer and use it in GitHub Desktop.
Save vadviktor/7bdf9068ee392e0639442e9816fb2f7d to your computer and use it in GitHub Desktop.
Download Ruby and Rails docs with https://gist.github.com/vadviktor/b3cb6e6b8f9a65fa31a7 and serve them locally with Caddy
#!/usr/bin/env bash
# JS script paths are absolute in some Ruby docs, convert them to relative.
fd --type file --extension html --full-path 'ruby_.*' --exec sd --string-mode 'src="/js/' 'src="js/'
# https://docs.docker.com/compose/compose-file/compose-file-v3/
version: "3.8"
services:
caddy:
image: caddy:2-alpine
ports:
- 22222:80
networks:
- ikon-services
restart: unless-stopped
volumes:
- $HOME/Documents/docs:/docs
command: caddy file-server --browse --root /docs
networks:
ikon-services:
name: ikon-services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment