AspireCloud/docker/traefik
Chuck Adams ee312f2882
add traefik proxy and frankenphp service as alternative to fpm (#17)
* refactor: replace nginx with frankenphp

* fix: add git and zip to the docker image

* refactor: parameterize bin/{create,remove}-external-network.sh

+resilience in remove script

* feat: add traefik proxy

* feat: add traefik-up and traefik-down Makefile targets

* doc: add traefik section to README

* doc: fix thinko

* docs: update traefik README

add note that you still need to edit /etc/hosts

* refactor: docker-compose configs for both nginx and frankenphp

* fix: use correct path to Dockerfile in docker-compose.frankenphp.yml

* feat: switch web backends via environment var (default nginx)
2024-10-16 07:54:20 -06:00
..
certs add traefik proxy and frankenphp service as alternative to fpm (#17) 2024-10-16 07:54:20 -06:00
traefik-config.d add traefik proxy and frankenphp service as alternative to fpm (#17) 2024-10-16 07:54:20 -06:00
docker-compose.yml add traefik proxy and frankenphp service as alternative to fpm (#17) 2024-10-16 07:54:20 -06:00
README.md add traefik proxy and frankenphp service as alternative to fpm (#17) 2024-10-16 07:54:20 -06:00
traefik.yaml add traefik proxy and frankenphp service as alternative to fpm (#17) 2024-10-16 07:54:20 -06:00

Docker Network Proxy

AspirePress Users

The steps below are of interest to anyone wanting to use the proxy with their own services. If you are building AspireCloud using the Makefile, all the below steps have already been performed, and you only need edit your /etc/hosts file as described in the project README.


How to proxy your own services

The proxy depends on an external network being defined, so run the following in your shell (you only ever need to do this once)

docker network create traefik

Enabling the proxy in docker-compose.yml

Add the following to the service you want proxied, substituting myservice and myhostname appropriately (myservice can be anything you want, but it must be unique across all your docker containers)

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.myservice.rule=Host(`myhostname.local`)"
  - "traefik.http.routers.myservice-https.rule=Host(`myhostname.local`)"
  - "traefik.http.routers.myservice-https.tls=true"
networks:
  - traefik

Add the following to the top level keys

networks:
  traefik:
    external: true

Add an entry to your hosts file

Add the following lines to your /etc/hosts file (C:\Windows\System32\drivers\etc\hosts on Windows)

127.0.0.1 myhostname.local
::1       myhostname.local