top of page
Search
Writer's pictureAndrew Silluron

Deploying Trudesk on Elastic Beanstalk

Trudesk is one of the leading open source help desk solutions with a robust API on the market today


I'll say that this was a semi-frustrating exercise for several reasons. Hopefully, by the time you are reading this, most of these issues have been solved


There are no explicit docs for multicontainer docker ports on EB (https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html) Normally, on all EB managed deployments, the app runs on port 8080. So, if you're going to change this for the Docker version, why not explicitly document it? If you're coming into the EB world fresh, it might not be an issue, since if you just copy-pasted the sample project, it would expose nginx on port 80


There's a bug that skips the MongoDB URI connection string when you're running Trudesk on Docker I've opened a PR to fix this, so hopefully it's all merged and fixed when you're reading this!

Step 1, Choose your docker image for Trudesk

  • polonel/trudesk (may not work if the PR above is not merged)

  • asilluron/trudesk:1.1.5 (Don't use other versions, 1.1.5 is the only stop-gap for the bug mentioned above, and I recommend you move back to the official image once the fix for MongoURIs is implemented)

  • Build your own. You should start with this repo if the PR above is not merged or start with the official repo if it's fixed


Step 2, Create a MongoDB instance

  • Use Atlas MongoDB, basically any instance size will work (including the free tier) and you can scale up as your business demands it

  • Use AWS Document DB, I recommend this option for enterprise. A cluster of 3 instances will get you "practical" HA. However, it's an expensive option for smaller shops.

Copy the MongoDB URI connection string after you create a cluster


Step 3, Create a Dockerrun.aws.json file


{
 "AWSEBDockerrunVersion": 2,
 "volumes": [
    {
 "name": "data",
 "host": {
 "sourcePath": "/var/app/current/usr/src/trudesk/public/uploads"
      }
    },
    {
 "name": "plugins",
 "host": {
 "sourcePath": "/var/app/current/usr/src/trudesk/plugins"
      }
    },
    {
 "name": "backups",
 "host": {
 "sourcePath": "/var/app/current/usr/src/trudesk/backups"
      }
    }
  ],
 "containerDefinitions": [
    {
 "name": "trudesk",
 "image": "asilluron/trudesk:1.1.5",
 "essential": true,
 "environment": [
        {
 "name": "TD_MONGODB_URI",
 "value": "INSERT CONNECTION STRING HERE"
        },
        {
 "name": "TRUDESK_DOCKER",
 "value": true
        },
        {
 "name": "NODE_ENV",
 "value": "production"
        }
      ],
 "portMappings": [
        {
 "hostPort": 80,
 "containerPort": 8118
        }
      ],
 "memory": 256,
 "mountPoints": [
        {
 "sourceVolume": "data",
 "containerPath": "/usr/src/trudesk/public/uploads"
        },
        {
 "sourceVolume": "plugins",
 "containerPath": "/usr/src/trudesk/plugins"
        },
        {
 "sourceVolume": "backups",
 "containerPath": "/usr/src/trudesk/backups"
        }
      ]
    }
  ]
}

Step 4, Deploy to Elastic Beanstalk


First, you want to create an App (will let you figure out those options) and you want to add an environment after. When creating an environment, you'll want to use the options below. In addition, you'll want to deploy with a sample application. Basically, if you make mistakes in your dockerrun.aws.json file, it will be much easier to roll out a new deployment once you have a sample app already running.


Once the environment is created, you simply click "upload and deploy" then select the json file you just created (Dockerrun.aws.json).


That's it! A self-hosted Trudesk deployment is extremely powerful.

161 views0 comments

Recent Posts

See All

Comments


bottom of page