Class: Orchestration::DockerCompose::AppService
- Inherits:
-
Object
- Object
- Orchestration::DockerCompose::AppService
- Includes:
- ComposeHelpers
- Defined in:
- lib/orchestration/docker_compose/app_service.rb
Class Method Summary collapse
Instance Method Summary collapse
- #definition ⇒ Object
-
#initialize(config, environment) ⇒ AppService
constructor
A new instance of AppService.
Methods included from ComposeHelpers
Constructor Details
#initialize(config, environment) ⇒ AppService
Returns a new instance of AppService.
8 9 10 11 |
# File 'lib/orchestration/docker_compose/app_service.rb', line 8 def initialize(config, environment) @environment = environment @config = config end |
Class Method Details
.command ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/orchestration/docker_compose/app_service.rb', line 14 def command server = env.web_server %w[bundle exec] + case env.web_server when 'puma' %w[puma -C config/puma.rb] when 'unicorn' %w[unicorn -c config/unicorn.rb] else unsupported_web_server(server) end end |
.entrypoint ⇒ Object
26 27 28 |
# File 'lib/orchestration/docker_compose/app_service.rb', line 26 def entrypoint ["/app/#{orchestration}/entrypoint.sh"] end |
.healthcheck ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/orchestration/docker_compose/app_service.rb', line 30 def healthcheck { 'test' => ['bundle', 'exec', 'rake', 'orchestration:healthcheck'], # Defaults according to # https://docs.docker.com/engine/reference/builder/#healthcheck # Except start_period which cannot be set to 0s 'interval' => '30s', 'timeout' => '30s', 'start_period' => '5s', 'retries' => 3 } end |
Instance Method Details
#definition ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/orchestration/docker_compose/app_service.rb', line 63 def definition { 'image' => image, 'environment' => environment, 'ports' => ports, 'deploy' => deploy, 'logging' => logging, 'networks' => networks } end |