Skip to content

Instantly share code, notes, and snippets.

@sashaaro
Last active January 25, 2021 13:52
Show Gist options
  • Save sashaaro/ac1ed79ed2e45ae53e0f936be008fe13 to your computer and use it in GitHub Desktop.
Save sashaaro/ac1ed79ed2e45ae53e0f936be008fe13 to your computer and use it in GitHub Desktop.
simple tunnel example
# public server compose for foobar.com
services:
nginx:
image: library/nginx:1.19.6
network_mode: host
volumes:
- ./conf.d:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt
tunnel:
image: jpillora/chisel:latest
network_mode: host
command: "server -p 8080 --reverse"
# client
services:
# any dev watcher server
serve:
image: node:14.15.4-alpine
entrypoint: npm
command: ["run", "watch"]
tty: true
ports:
- "3000:3000"
tunnel:
image: jpillora/chisel:latest
network_mode: host
command: "client foobar.com:8080 R:3000:3000"
# conf.d/foobar.conf
server {
server_name foobar.com www.foobar.com;
listen *:443 ssl;
ssl_certificate /etc/letsencrypt/live/foobar.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/foobar.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/foobar.com/chain.pem;
location / {
proxy_pass http://localhost:3000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment