Skip to content

Commit 0d45f5f

Browse files
author
Christopher Goddard
authored
Apply additional changes to support running in docker (#379)
1 parent 02792e2 commit 0d45f5f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/zendesk_apps_tools/command.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Command < Thor
1111
include ZendeskAppsTools::CommandHelpers
1212

1313
map %w[-v] => :version
14+
DEFAULT_SERVER_IP = '0.0.0.0'
1415
DEFAULT_SERVER_PORT = '4567'
1516

1617
source_root File.expand_path(File.join(File.dirname(__FILE__), '../..'))
@@ -158,7 +159,7 @@ def clean
158159
method_option :config, default: DEFAULT_CONFIG_PATH, required: false, aliases: '-c'
159160
method_option :port, default: DEFAULT_SERVER_PORT, required: false, desc: 'Port for the http server to use.'
160161
method_option :app_id, default: DEFAULT_APP_ID, required: false, type: :numeric
161-
method_option :bind, required: false
162+
method_option :bind, default: DEFAULT_SERVER_IP, required: false
162163
method_option :plan, required: false
163164
def server
164165
setup_path(options[:path])

lib/zendesk_apps_tools/theme.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Theme < Thor
1111
desc 'preview', 'Preview a theme in development'
1212
shared_options(except: %i[clean unattended])
1313
method_option :port, default: Command::DEFAULT_SERVER_PORT, required: false, desc: 'Port for the http server to use.'
14-
method_option :bind, required: false
14+
method_option :bind, default: Command::DEFAULT_SERVER_IP, required: false
1515
method_option :livereload, type: :boolean, default: true, desc: 'Enable or disable live-reloading the preview when a change is made.'
1616
method_option :force_polling, type: :boolean, default: false, desc: 'Force the use of the polling adapter.'
1717
def preview

scripts/invoke.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ check_cmd_in_path docker
2020
# When running the zat container, mount the current directory to /app
2121
# so that zat has access to it.
2222
docker run \
23+
--network="bridge" \
2324
--interactive --tty --rm \
2425
--volume "$PWD":/wd \
2526
--workdir /wd \

0 commit comments

Comments
 (0)