Onboard Service to Traefik
Add this service to the Traefik reverse proxy at ingress-apps network.
Requirements
- •Find the docker-compose.yml in this repo
- •Identify the main service that needs external access
- •Ask for the subdomain (e.g.,
myappformyapp.lima.red) - •Ask for the container port if not obvious from the compose file
Changes to make
Add the external network definition:
yaml
networks:
ingress-apps:
external: true
Add the network to the service:
yaml
services:
<service>:
networks:
- ingress-apps
Add Traefik labels to the service (replace ROUTERNAME with a unique identifier):
yaml
labels: - "traefik.enable=true" - "traefik.http.routers.ROUTERNAME.rule=Host(`SUBDOMAIN.lima.red`)" - "traefik.http.routers.ROUTERNAME.entrypoints=websecure" - "traefik.http.routers.ROUTERNAME.tls.certresolver=letsencrypt" - "traefik.http.services.ROUTERNAME.loadbalancer.server.port=PORT"
After changes
Remind the user to:
- •Create a DNS A record for
SUBDOMAIN.lima.redpointing to their server IP - •Run
docker compose up -dto start/restart the service