sobota, 1 lutego 2020

traefik + java service (docker-compose)


version: '3.3'
services:
    javaservice-1:
        image: service
        container_name: javaservice-1
        restart: always
        labels:
            - traefik.enable=true
            - traefik.http.routers.javaservicerouter.rule=Host(`localhost`)
            - traefik.http.routers.javaservicerouter.entrypoints=web
            - traefik.port=8080
        networks:
            - web
    traefik:
        image: 'traefik:latest'
        container_name: traefik
        command:
            - '--log.level=INFO'
            - '--api.insecure=true'
            - '--providers.docker=true'
            - '--providers.docker.exposedbydefault=false'
            - '--entrypoints.web.address=:80'
            - '--entrypoints.test.address=:8081'
        networks:
            - web
        ports:
            - '80:80'
            - '8080:8080'
            - '8081:8081'
        volumes:
            - '/var/run/docker.sock:/var/run/docker.sock:ro'
networks:
    web:
        external:
            name: traefik_webgateway
Podziel się:

0 komentarze:

Prześlij komentarz