Method: Kowl::Docker#docker_sidekiq_service

Defined in:
lib/kowl/docker.rb

#docker_sidekiq_service(database = 'sqlite3') ⇒ String

Generate and return the sidekiq service for the applicatio

Parameters:

  • database (String) (defaults to: 'sqlite3')

    a string containing the containers database type

Returns:

  • (String)

    a string containing the sidekiq service for the docker-compose filee



95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/kowl/docker.rb', line 95

def docker_sidekiq_service(database = 'sqlite3')
  cmd_str = "#{docker_port_watcher(database, false)}rm -rf /app/.local >/dev/null 2>&1 &&\nbundle exec sidekiq"
  cmd_str = optimize_indentation(cmd_str, 13).strip

  <<-SIDEKIQ_SERVICE
  sidekiq:
<<: *x-app_base
image: #{app_name}_base:latest
command: >
  sh -c "#{cmd_str}"
depends_on:
  - base
  SIDEKIQ_SERVICE
end