Traefik automated dev/prod environment with docker-compose

Home   »   Traefik automated dev/prod environment with docker-compose

Base Scafold project for a docker-compose with traefik, only 2 services api and pwa, no additional files needed.
version: '3.5'

services:
    traefik:
        image: 'traefik:v2.3.6'
        command:
            - --entrypoints.web.address=:80
            - --providers.docker
            - --api.insecure
        ports:
            - '80:80'

        volumes:
            - '/var/run/docker.sock:/var/run/docker.sock:ro'
    pwa:
        build: ./pwa
        ports:
            - 3002:3002
        labels:
            - traefik.http.routers.pwa.rule=Host(`awesome-domain.local`)
            - traefik.http.services.pwa.loadbalancer.server.port=3002
    api:
        build: ./api
        ports:
            - 3001:3001
        labels:
            - traefik.http.routers.api.rule=Host(`api.awesome-domain.local`)
            - traefik.http.services.api.loadbalancer.server.port=3001

   

Leave a Reply

Your email address will not be published.