Skip to content

Instantly share code, notes, and snippets.

@weivall
Created November 7, 2019 17:03
Show Gist options
  • Save weivall/a91a3d536542397c115de3f02af10817 to your computer and use it in GitHub Desktop.
Save weivall/a91a3d536542397c115de3f02af10817 to your computer and use it in GitHub Desktop.
docker ssh tunnel
# vi: tw=2 ts=2 sw=2
version: '3.7'
services:
db-remote:
build:
context: var/ssh
container_name: ssh-tunnel
restart: always
environment:
- [email protected]
- LOCAL_PORT=5432
- REMOTE_PORT=5432
- REMOTE_HOST=localhost
secrets:
- source: id_rsa
target: /root/.ssh/id_rsa
ports:
- 5433:5432
secrets:
id_rsa:
file: ${HOME}/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment