{"id":18572408,"url":"https://github.com/a/local-traefik","last_synced_at":"2026-03-19T05:06:02.599Z","repository":{"id":186471067,"uuid":"631868045","full_name":"A/local-traefik","owner":"A","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-24T08:26:41.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T14:29:49.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/A.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-24T08:25:09.000Z","updated_at":"2025-02-11T10:46:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"acb5e211-09d8-44e6-9e10-2b9e0c1b292f","html_url":"https://github.com/A/local-traefik","commit_stats":null,"previous_names":["a/local-traefik"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A%2Flocal-traefik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A%2Flocal-traefik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A%2Flocal-traefik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A%2Flocal-traefik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/A","download_url":"https://codeload.github.com/A/local-traefik/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436951,"owners_count":22070947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:06:08.266Z","updated_at":"2026-01-23T09:19:01.319Z","avatar_url":"https://github.com/A.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traefik v2 HTTPS SSL Localhost\n\nThis project provides a Docker Compose template for setting up Traefik v2 with HTTPS and SSL support for localhost. It also includes an example template for setting up multiple Postgres connections.\n\n## Setup\n\nTo get started, create a Docker network using the following command:\n\n```sh\n# Create a Docker network\ndocker network create traefik\n```\n\nYou will also need to generate SSL certificates for the domain \"docker.localhost\" and \"domain.local\" along with their sub-domains. You can use [mkcert](https://github.com/FiloSottile/mkcert) to generate the certificates. Install mkcert using the command `mkcert -install` and then generate the certificates using the following command:\n\n```sh\n# Generate certificates\nmkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem \"localhost\" \"*.localhost\" \"localhost\"\n```\n\nMake sure to place the generated certificates in the `certs` directory of this project.\n\n## Multiple Postgres Connections\n\nYou can use the provided Docker Compose template to set up multiple Postgres connections. Here's an example template for the Postgres service:\n\n```yaml\nservices:\n  db:\n    hostname: ${POSTGRES_HOST}\n    image: postgres:12.0-alpine\n    restart: unless-stopped\n  \n    environment:\n      POSTGRES_USER: ${POSTGRES_USER:-user}\n      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}\n      POSTGRES_DB: ${POSTGRES_DB:-db}\n\n    labels:\n      - traefik.enable=true\n      - traefik.tcp.routers.postgres.tls=true\n      - traefik.tcp.routers.postgres.rule=HostSNI(`${DB_HOST}`)\n      - traefik.tcp.routers.postgres.entrypoints=postgres\n      - traefik.tcp.services.postgres.loadbalancer.server.port=5432\n  \n    expose:\n      - 5432\n\n    networks:\n      - traefik\n```\n\nThis template sets up a Postgres service with Traefik labels for enabling HTTPS, SSL, and routing based on the Host SNI (Server Name Indication) header. It also exposes port 5432 and connects to the `traefik` Docker network.\n\nDon't forget to add the `$POSTGRES_HOST` to your `/etc/hosts` file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa%2Flocal-traefik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa%2Flocal-traefik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa%2Flocal-traefik/lists"}