Table of Contents
The goal is to be able to run you website locally using HTTPS. We use traefik and a self-signed certificate to achieve this. By just assigning labels to your docker containers, you can have a local proxy that will route your requests to the correct container.
Docker
Make
- Clone the repo
git clone https://github.com/Te4g/treafik-local-proxy.git
- Optional: you can change the domain used in the
cert.conf
file, default isdev.localhost
- Run
make install
- Run
make start
Once this project is running, you can then start your other projects by adding to your compose.yaml
file some labels:
/!\ Be careful to only use a third level domain, like my-project-name.dev.localhost
and not api.my-project-name.dev.localhost
or my-project-name.localhost
labels:
- "traefik.enable=true"
- "traefik.http.routers.my-project-name.rule=Host(`my-project-name.dev.localhost`)"
- "traefik.http.routers.my-project-name.entrypoints=websecure"
- "traefik.http.routers.my-project-name.tls=true"