Docker4drupal: Traefik 2 released, and container stop working.

Created on 17 Sep 2019  路  14Comments  路  Source: wodby/docker4drupal

https://hub.docker.com/_/traefik?tab=tags

The Traefik 2 is released. Since in docker-compose.yml we have

  traefik:
    image: traefik

It gets the last available release. But seems 1.7 and 2.0 is not BC releases and this cause problem.

As a temporary solution I used a specific tag:

  traefik:
    image: traefik:v1.7.16-alpine

docker-compose.yml must be updated to traefik 2 settings or have a tag version as other containers.

All 14 comments

Same issue, with the specific tag indicated by Niklan, it works perfectly as temporary solution.

PR in #402 should provide a temporary fix until Traefik 2.0 can be fully supported.

traefik.yml

version: '2'

services:
  traefik:
    image: traefik:v2.0
    restart: unless-stopped
    command:
      - "--api.insecure=true"
      - "--providers.docker"
      - "--providers.docker.exposedbydefault=false"
    networks:
      - "xxxx"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

networks:
  xxxx:
    external:
      name: xxxx_default

Replace the existing rules in docker compose with something like this:

- "traefik.enable=true"
- "traefik.http.routers.${PROJECT_NAME}_portainer.rule=Host(`portainer.${PROJECT_BASE_URL}`)"

YMMV

Merged #402 to pin traefik to v1. Upgrade to v2 will be performed with the next release

Anyone know why the alpine image is slightly larger (+5mb)? And what, if any, are the differences behind the scenes?

perhaps the previous latest image wasn't actually alpine-based but was from scratch, so I guess the right tag would be just 1.7 instead of v1.7.16-alpine but I don't it makes a difference

The same isssue in local multisite traefik.yml.
Solved:
`version: '2'

services:
traefik:
image: traefik:v1.7.16-alpine
restart: unless-stopped
command: -c /dev/null --web --docker --logLevel=DEBUG
networks:
- project1
- project2`

Docker4Drupal 5.4.11 has been released with traefik v2 support, update your docker-compose.yml with new traefik service and traefik labels.

Still problems with multiple project in local environment using traefik:v2.0 or traefik:v2.0.2
Container traefik restart every few seconds.
In logs we can see:
command traefik error: failed to decode configuration from flags: field not found, node: c

You should update the command of traefik service.

Sorry for my insistence, I will say that you must update traefik.yml to adjust to the parameters of docker-compose.yml (traefik section). If you download Docker4Drupal 5.4.11 to install in multiple project in local environment they still fails..

@csandanov so you mean to say now we can run multiple docker projects with this new traefik?
Like ..

/var/www/html/project1 - docker-compose up

-- different prompt
/var/www/html/project2 - docker-compose up

No. Install a traefik container for all the projects (dockers) in the same server (ip). See: https://wodby.com/docs/stacks/drupal/local/ section: Running multiple Projects.

traefik.yml content is now also updated for v2, missed that before

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzavrl picture jzavrl  路  3Comments

pulasthibandara picture pulasthibandara  路  6Comments

VladSavitsky picture VladSavitsky  路  6Comments

LordFransie picture LordFransie  路  3Comments

andrewhorokhovets picture andrewhorokhovets  路  8Comments