GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - granite-so/pg-proxy: Simple TCP proxy in a Docker container using HAProxy, configured for PostgreSQL endpoints via BACKEND_HOST/BACKEND_PORT, with health checks.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
haproxy.cfg
haproxy.cfg
 
 

Repository files navigation

docker-tcp-proxy

Simple TCP Proxy in a Docker Container using HAproxy

Why?

Sometimes you may need to forward a TCP connection and don't want to setup IPTables or a complicated application proxy. This container was originally created to route Redis requests to an AWS Elasticache backend from a network that did not have access to the VPC elasticache was configured in.

AWS documentation recommends setting up a NAT instance with iptable rules. This container makes it possible to setup a simple HAproxy configuration that proxies requests instead.

Usage

Environment Variables

When running the container two Environment Variables are required

  • BACKEND_HOST
    • IP or hostname to proxy connections to
  • BACKEND_PORT
    • The port number to proxy connections to. This is also the port the container listens on.

Building the Container

docker build -t docker-tcp-proxy .

Running the Container

The following example forward TCP requests on port 6379 to an Elasticache instance on my-elasticache.domain.com:6379

docker run -it -p 6379:6379 --rm -e "BACKEND_HOST=my-elasticache.domain.com" -e "BACKEND_PORT=6379 docker-tcp-proxy

Deploying to Rancher

This repository contains a compose file to deploy a Redis proxy to a Rancher cluster. By default it listens on port 23201.

Environment File

Create the environment .env.export file with the BACKEND_HOST and BACKEND_PORT values,

BACKEND_HOST=redis.your-domain.com
BACKEND_PORT=6379

Deploying

Deploy the container to Rancher with rancher-compose

rancher-compose --file redis-tcp-proxy.yml \
                --env-file .env.export \
                --project-name redis-proxy \
                up \
                --force-upgrade \
                --confirm-upgrade \
                --pull \
                -d

About

Simple TCP proxy in a Docker container using HAProxy, configured for PostgreSQL endpoints via BACKEND_HOST/BACKEND_PORT, with health checks.

Topics

dockerhaproxyinfrastructurepostgresqlproxytcp-proxy

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.