version: '2'
services:
  redmine:
    image: sameersbn/redmine:3.3.2-1
    labels:
      io.rancher.container.hostname_override: container_name
      io.rancher.container.pull_image: always
      traefik.enable: true
      traefik.alias: ${REDMINE_HOST}
      traefik.domain: ${REDMINE_DOMAIN}
      traefik.acme: true
      traefik.port: 80
    environment:
    - PORT=80
    - TZ=${TZ}
    - DB_PASS=${DB_PASS}
    - DB_ADAPTER=mysql2
    - DB_HOST=db
    - DB_USER=redmine
    - DB_NAME=redmine_production
    - REDMINE_SECRET_TOKEN=${REDMINE_SECRET_TOKEN}
    - SMTP_ENABLED=false
    - IMAP_ENABLED=false
    volumes:
      - redminedata:/home/redmine/data
      - redminelog:/var/log/redmine
  db:
    restart: always
    image: mariadb:10.2
    volumes:
      - redminedbdata:/var/lib/mysql
    labels:
      io.rancher.container.pull_image: always
    environment:
    - MYSQL_USER=redmine
    - MYSQL_PASSWORD=${DB_PASS}
    - MYSQL_ROOT_PASSWORD=${DB_PASS}
    - MYSQL_DATABASE=redmine_production
volumes:
  redminedata:
    driver: ${VOLUME_DRIVER}
  redminelog:
    driver: ${VOLUME_DRIVER}
  redminedbdata:
    driver: ${VOLUME_DRIVER}
