Skip to content

scflode/dev-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev-proxy

This repository contains a reverse proxy setup via traefik that allows to have multiple services with the same port running locally at once without port juggling.

Further it allows to have full TLS support by leveraging mkcert.

The Docker container starts when the Docker daemon starts (usuallty on startup). This means you do not need to worry about it.

The new version with dynamic multi database support (only when HostSNI is supported).

Prerequisites

In order to use the dev-proxy you need to have installed the following:

  • Docker
  • Install mkcert:
    • brew install mkcert nss (macOS)
    • choco install mkcert (Win)
    • Linux
  • Clone this repository

Setup

With the prerequisites satisfied you can run make setup. This automatically sets up everything needed to use the dev-proxy. This target is idempotent.

Usage

In order to use the dev-proxy use make up or make up logs.

Note

This requires the dev-proxy to be setup properly as described in the section "Setup".

Add a new domain and network

To add a new domain you can use make add domain="my-domain.localhost network="my_network".

Example setup of an existing project

To setup an already configured project (see Services) called app (this is the container service you want to access) with the network called my_network and the desired domain my_domain you run:

make add domain=my_domain network=my_network
make up

Important

Next please check Domains for information about mapping the domains to 127.0.0.1 either via /etc/hosts or dnsmasq.

The you can access the project via your browser as [https://app.my_domain.localhost].

If the project has the database labels also configured (or has a database at all) you can then given the database service is configured as db access the database locally via the host db.my_domain.localhost port 15432 (!) and the respective username and password as well as other project specific settings.

Remove a domain and network

To remove a domain you can use make remove domain="my-domain.localhost" network="my_network".

Troubleshooting

When you encounter problems with not reachable services you can open [https://localhost]. This shows the Traefik dashboard.

Another useful thing could be to run make logs that tails the Traefik container logs.

More information

For all available targets you can run make or make help.

License

MIT

About

A Docker based proxy to allow for TLS secured local development

Resources

License

Stars

Watchers

Forks

Packages

No packages published