Class: Dip::Commands::Nginx::Up

Inherits:
Dip::Command show all
Defined in:
lib/dip/commands/nginx.rb

Instance Method Summary collapse

Methods inherited from Dip::Command

exec_program, exec_subprocess

Constructor Details

#initialize(name:, socket:, net:, publish:, image:, domain:, certs:) ⇒ Up

Returns a new instance of Up.



10
11
12
13
14
15
16
17
18
# File 'lib/dip/commands/nginx.rb', line 10

def initialize(name:, socket:, net:, publish:, image:, domain:, certs:)
  @name = name
  @socket = socket
  @net = net
  @publish = publish
  @image = image
  @domain = domain
  @certs = certs
end

Instance Method Details

#executeObject



20
21
22
23
# File 'lib/dip/commands/nginx.rb', line 20

def execute
  exec_subprocess("docker", "network create #{@net}", panic: false, err: File::NULL)
  exec_subprocess("docker", "run #{container_args} #{@image}")
end