OTRS 5 on docker HOWTO

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

OTRS 5 on docker HOWTO

Postby jbaptiste » 17 Jun 2016, 08:42

Hi,

At the company I work at we have been running OTRS 4 on docker on production for multiple companies without issues for over a year now with more than 10k downloads on docker hub. I was planning on posting earlier about them here but, you know...life happens. Now I had some free time again I managed to finish the update to OTRS 5 so I decided to post about it here. If you aren't familiar with docker then please read about it here and install it first, along with docker-compose.

With docker everything is more easy :), to start all the components of an OTRS install you just need to use a docker-compose.yml service definition file like the following one:

Code: Select all

version: '2'
services:
  otrs:
    image: juanluisbaptiste/otrs:latest
    ports:
    - "80:80"
    links:
    - mariadb:mariadb
    - postfix:postfix
    volumes_from:
    - data
    environment:
        MYSQL_ROOT_PASSWORD: changeme
        OTRS_ROOT_PASSWORD: changeme
        OTRS_NUMBER_GENERATOR: Date
        OTRS_LANGUAGE: es
        OTRS_POSTMASTER_FETCH_TIME: 5

  mariadb:
    image: juanluisbaptiste/otrs-mariadb:latest
    expose:
    - "3306"
    volumes_from:
    - data
    environment:
        MYSQL_ROOT_PASSWORD: changeme

  postfix:
     image: juanluisbaptiste/postfix:latest
     expose:
     - "25"
     environment:
       SMTP_SERVER=smtp.yourcompany.com
       SMTP_USERNAME=otrs@yourcompany.com
       SMTP_PASSWORD=xxxxxxx
       SERVER_HOSTNAME=support.yourcompany.com

#  nginx:
#   image: juanluisbaptiste/bigbluebutton-proxy
#    ports:
#      - "80:80"
#      - "443:443"
#    volumes:
#     - /var/run/docker.sock:/tmp/docker.sock
#      - "/etc/localtime:/etc/localtime:ro"

  data:
    image: centos/mariadb:latest
    volumes:
    - /var/lib/mysql
    - "./otrs/backup:/var/otrs/backups"

    command: /bin/true


This yml file defines all the containers needed to run OTRS, their initial configuration state, the container startup order and their dependencies. The previous docker-compose.yml file starts the following containers for a complete OTRS system:

  • A web server container with OTRS installed and ready to use.
  • A MySQL database server container preconfigured with needed settings according to the installation instructions.
  • An SMTP Relay container.
  • A data volume container to store OTRS data files (database files, /var/*, etc).
  • A nginx proxy server container (optional).

Environment variables are used to set the initial configuration for each container. On this example, OTRS will use the Date number generator, it will check for emails each 5 minutes, use spanish by default for the web interface and setup MySQL and admin passwords. There are a bunch of variables that can be set to customize the installation, there's a complete list at the github project page, for example, to start the OTRS container from an existing backup, or how to change the web theme.

Modify the environment variables on the docker-compose.yml file as needed and start the OTRS service like this:

First, pull all container images:

Code: Select all

sudo docker-compose pull


Then, start all containers:

Code: Select all

sudo docker-compose up -d


Wait some seconds (yes, seconds) for all the containers to finish up starting up and go to the administration interface at:

http://localhost/otrs/

Now you can go ahead and start configuring and using your new dockerized OTRS install. There's more information on this blog post.

I hope this is also helpul for someone else :D
Last edited by jbaptiste on 01 Aug 2017, 03:33, edited 1 time in total.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

RStraub
OTRS guru
Posts: 2050
Joined: 13 Mar 2014, 09:16
OTRS Version?: 5.0.14
Real Name: Rolf Straub

Re: OTRS 5 on docker HOWTO

Postby RStraub » 17 Jun 2016, 09:04

Wow.

I'm still having some kind of love/hate for docker, but I very much appreciate your information, especially the .yml file!
Currently using: OTRS 5.0.14 -- MariaDB -- Ubuntu 16 LTS

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 17 Jun 2016, 21:52

RStraub wrote:Wow.

I'm still having some kind of love/hate for docker, but I very much appreciate your information, especially the .yml file!



I LOVE docker, it has made my life at work so much easier, but its true that it has some learning curve too. not because it is difficult to use but more that its a different way of doing things as what admins have been normally doing (baremetal and VMs) for years and it takes some time to fully understand the advantages of containers and how docker makes everything very easy to do, like bringing a complete fresh OTRS install up in a matter of seconds instead of hours/days doing it the "traditional" ways.

Test it and let me know how it goes.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

Julian0o
OTRS expert
Posts: 55
Joined: 14 May 2014, 13:28
OTRS Version?: 5.0.7

Re: OTRS 5 on docker HOWTO

Postby Julian0o » 19 Oct 2016, 14:43

Thanks for the Docker Image!

What about using Plugins? I use Kix4OTRS and i have no idea if it's working perfectly with you docker Installation.
OTRS 5.x & KIX4OTRS

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 20 Oct 2016, 02:54

Julian0o wrote:Thanks for the Docker Image!

What about using Plugins? I use Kix4OTRS and i have no idea if it's working perfectly with you docker Installation.


By plugins you mean addons ? if yes it shouldn't be too difficult to implement, I think it would be just a matter of understanding how they can be installed manually so it can be scripted on the container's startup script, and configured through an env variable. It's in my TODO list, but I really have no idea on when I will have the time to work on it. If you want to give it a try I can help you getting it done.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 22 Mar 2017, 19:09

jbaptiste wrote:
Julian0o wrote:Thanks for the Docker Image!

What about using Plugins? I use Kix4OTRS and i have no idea if it's working perfectly with you docker Installation.


By plugins you mean addons ? if yes it shouldn't be too difficult to implement, I think it would be just a matter of understanding how they can be installed manually so it can be scripted on the container's startup script, and configured through an env variable. It's in my TODO list, but I really have no idea on when I will have the time to work on it. If you want to give it a try I can help you getting it done.


About this, I added a new feature to automatically reinstall modules on container remove/update that have been added through the web gui. Before they got broken after an update and they needed to be manually reinstalled on the admin packages page.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 25 Sep 2017, 00:03

What happened to the original post ? I made a little modification and it disappeared, this was weeks ago and when I noticed it I sent a PM to one of the modedators (crythias) a couple weeks ago but no answer. I have the original post if needed.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 24 Jan 2018, 04:55

jbaptiste wrote:What happened to the original post ? I made a little modification and it disappeared, this was weeks ago and when I noticed it I sent a PM to one of the modedators (crythias) a couple weeks ago but no answer. I have the original post if needed.


Many thanks to the mod that restored it : )
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 24 Jan 2018, 05:03

Hi,

I have been working on the update to OTRS 6 (6.0.4), it's mostly ready and available on docker hub as juanluisbaptiste/otrs:6beta, I would appreciate some feedback on it.

OTRS 5 image has been updated to latest version (5.0.26), the same for OTRS 4 (4.0.28).

The only issue I have so far seems to be with sending emails through an external SMTP relay (as this project has always done), no errors when for example, sending the email from a new ticket, just a message saying that the message has been queued for sending, but no errors on any logs and emails never arrive to the SMTP relay. Probably nothing to do with the docker container but I haven't found any references to this problem on the internet.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 04 Feb 2018, 08:55

Everything seems to be working very well !! I will be releasing OTRS 6 image during next week and I'll be blogging about the new features too. In the mean time here's a teaser:

Image
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO

jbaptiste
OTRS expert
Posts: 62
Joined: 01 Aug 2015, 03:45
OTRS Version?: 5.0.21

Re: OTRS 5 on docker HOWTO

Postby jbaptiste » 14 Feb 2018, 03:17

Well it took me a little more to get this one out the door but here it is, the unofficial OTRS 6 images are available, you can read more about the container's new features in my blog and write your feedback here.

Old versions are still available at dockerhub, tagged with its version:

  • juanluisbaptiste/otrs:latest (latest 6.0.x version)
  • juanluisbaptiste/otrs:6.0.x
  • juanluisbaptiste/otrs:5.0.x
  • juanluisbaptiste/otrs:4.0x

Feedback welcome.
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO


Return to “Howtos”

Who is online

Users browsing this forum: No registered users and 1 guest