Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Openproject 12 with traefik

Openproject 12 with traefik

Added by Armin Aulinger over 2 years ago

Hi,

does anybody have a sample yml script to run openproject 12 with traefik as reverse proxy in a docker environment?

This would be helpful for me to get started with my project.


Replies (4)

RE: Openproject 12 with traefik - Added by Adam Szabo over 2 years ago

Hi, we suggest running apache2 or nginx as a docker container for proxiing OpenProject in docker.

Could you please share traefik repository and version which you are using?

RE: Openproject 12 with traefik - Added by Yohann Marillet about 2 years ago

Hello, I'm also interested to plug-in a Traefik as a reverse proxy for an OpenProject application

I tried to set Traefik's labels on both the proxy service and the web service of openproject 12 docker-compose definitions, but I'm only getting 499 errors in Traefik logs (tried ports 80, 8080, custom ... I don't get what I miss)

Using Traefik v2.9, no https for basic use case

RE: Openproject 12 with traefik - Added by Yohann Marillet about 2 years ago

Nevermind, I had a typo in my domain name ....

It's working perfectly fine to set the labels on the proxy container :)

traefik.yml

global:
  checkNewVersion: true
  sendAnonymousUsage: true

api:
  dashboard: true

providers:
  docker:
    exposedByDefault: false
    swarmMode: false
  
entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: ":443"
    http:
      tls:
        certResolver: letsencrypt
    
certificatesResolvers:
  letsencrypt:
    acme:
      email: your@email.tld
      storage: acme.json
      httpChallenge:
        entryPoint: web
        
log:
  level: DEBUG
  
accessLog: {}

Traefik docker-compose.yml

version: '3.7'

configs:
  traefik.yml:
    file: ./traefik.yml

services:
  traefik:
    restart: unless-stopped
    image: traefik:2.9
    ports:
    - "80:80"
    - "443:443"
    labels:
    - "traefik.enable=true"
    - "traefik.http.routers.traefikApi.rule=Host(`traefik.domain.tld`)"
    - "traefik.http.routers.traefikApi.entryPoints=websecure"
    - "traefik.http.routers.traefikApi.service=api@internal"
    - "traefik.http.routers.traefikApi.middlewares=traefikApiBasicAuth"
    - "traefik.http.routers.traefikApi.tls=true"
#     "$" characters must be doubled in labels
    - "traefik.http.middlewares.traefikApiBasicAuth.basicauth.users=yourname:$$2y$$aaabbbcccddd"
    
    networks:
    - your_traefik_network
    
    configs:
    - source: traefik.yml
      target: /etc/traefik/traefik.yml
    
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - ./volumes/acme.json:/acme.json

networks:
  your_traefik_network:
    external: true

Openproject v12 docker-compose.yml

services:
  # ....
  
  proxy:
    <<: [*image, *restart_policy]
    command: "./docker/prod/proxy"
# You can comment/remove ports exposure, it's now handled by traefik
#    ports:
#      - "${PORT:-8080}:80"
    environment:
      APP_HOST: web
      OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
    depends_on:
      - web
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.openproject.loadbalancer.server.port=80"
      - "traefik.http.routers.openproject.rule=Host(`yourdomain.tld`)"
      - "traefik.http.routers.openproject.entryPoints=websecure"
      - "traefik.http.routers.openproject.tls=true"
      - "traefik.http.routers.openproject.service=openproject"
    networks:
      - frontend
      # add it here
      - your_traefik_network

networks:
  frontend:
  backend:
  # you must connect an external network (also present in the docker-compose/conf of Traefik)
  your_traefik_network:
    external: true

Happy openprojecting :)

Edit: forgot the "traefik.http.routers.openproject.service" line yesterday, added it this morning.

RE: Openproject 12 with traefik - Added by Yohann Marillet about 2 years ago

I also found out sometimes Traefik (or just docker ?) seems lost in the networking when the "web" service from OpenProject crashes at the first initialization - this is acutally in such case where I get 499 responses in Traefik. Just restart the proxy service: docker-compose restart proxy , and it should work.

  • (1 - 4/4)
Loading...