Help Center


Caprover production deployment

https://app.chaskiq.io/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbXdEIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--827f2d0b5794f7bb660c48b79e228655bd857bed/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVdscGFRPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--cf24ea7784b3789671bb09c4029aca003c26b32d/me.jpg

Written by Miguel Michelson

updated

There are many ways to deploy chaskiq on the cloud. This article is about the deploy of Chaskiq's Docker image on Caprover.

Requirements:

Chaskiq has two databases that is has to be connected, that's Redis and Postgres. It will depend on where you will deploy this how you will connect to DB. Given that you want to deploy this on Caprover, maybe a good idea is to install the databases as a Caprover installation too!

Environment Variables: Make sure you put the proper environment variables on the prompt, but don't worry you could also edit this later. Check the Chaskiq environment variables article.

Installation

For the deployment you will need to put a depoyment command on the method 5 input,
The page is somewhat large, so you will have to scroll down to find it.

In the method 5 field put the following:

{
  "schemaVersion": 2,
  "dockerfileLines": [
     "FROM chaskiq/chaskiq:latest",
     "CMD bundle exec rails db:setup; bundle exec rails db:migrate; bundle exec rails packages:update; bundle exec rails s -b  0.0.0.0 -p 3000"
  ]
}

That will start the Web app on port 3000 so , go to the HTTP settings and set the port container to 3000

Sidekiq Worker

Chaskiq does some background tasks in order to not block the web process with heavy tasks like emails, file uploading and messaging, The process that handles all the work is a Sidekiq server that has to be installed to, This are different as web apps because they don't receive internet traffic, they just receive instructions internally to perform tasks. Once you got the Web app working you will need to add Sidekiq as an App Worker component. So, you will have to repeat the same procedure as above but the command with the specific sidekiq command:

{ 
  "schemaVersion": 2,  
  "dockerfileLines": [
    "FROM chaskiq/chaskiq:latest",
    "CMD bundle exec sidekiq -C config/sidekiq.yml"
    ]
}

Don't forget to set up the ENV vars for this app too.



Note that we are using the image chaskiq/chaskiq:latest , you could use some version too if you want to restrict the platform to a fixed version.

That's it, happy deploying!