Created
November 7, 2019 17:03
-
-
Save weivall/a91a3d536542397c115de3f02af10817 to your computer and use it in GitHub Desktop.
docker ssh tunnel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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