Class: GrokCLI::Docker::Node::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/grok_cli/docker/node/setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = GrokCLI::Docker::Configuration.new) ⇒ Setup

Returns a new instance of Setup.



3
4
5
# File 'lib/grok_cli/docker/node/setup.rb', line 3

def initialize(config = GrokCLI::Docker::Configuration.new)
  @config = config
end

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/grok_cli/docker/node/setup.rb', line 7

def execute
  system <<~CMD

    docker-machine create #{@config.machine_name} --driver virtualbox

    eval "$(docker-machine env #{@config.machine_name})"

    docker-compose build

    docker-compose run --rm web npm -g install webpack
    docker-compose run --rm web npm install

    cp .env.example .env

  CMD
end