From 16f647642c689d68c5f40c01dbca06600a3640a6 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 20 Jul 2019 00:28:10 +0200 Subject: [PATCH] Fixes running Jekyll preview in devcontainer (#9920) --- .devcontainer/Dockerfile | 3 +++ Rakefile | 1 + 2 files changed, 4 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a981cd420fc..e041b33ae3c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,6 +6,9 @@ ENV DEBIAN_FRONTEND=noninteractive # Use Bash as the default shell ENV SHELL=/bin/bash +# Set an environment variable to be able to detect we are in dev container +ENV DEVCONTAINER=true + # Locale env vars ENV \ LANG=en_US.UTF-8 \ diff --git a/Rakefile b/Rakefile index 20aba5bf915..860f95e79c4 100644 --- a/Rakefile +++ b/Rakefile @@ -89,6 +89,7 @@ end desc "preview the site in a web browser" task :preview, :listen do |t, args| listen_addr = args[:listen] || '127.0.0.1' + listen_addr = '0.0.0.0' unless ENV['DEVCONTAINER'].nil? raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}" system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")