Merge pull request #231 from samnazarko/port_bind_check_fix
authorSam <sam.saffron@gmail.com>
Mon, 4 Apr 2016 21:48:00 +0000 (07:48 +1000)
committerSam <sam.saffron@gmail.com>
Mon, 4 Apr 2016 21:48:00 +0000 (07:48 +1000)
Inform the user that they can --skip-prereqs if they want to continue after port check fails

launcher
samples/standalone.yml
samples/web_only.yml
templates/web.template.yml

index 8471e817722ed3ffb73b006e817f44d2928edfe4..556a7b53b3933b59e2e411a86033960dc218494c 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -503,10 +503,28 @@ run_start(){
    set_run_image
    set_boot_command
 
+   # get hostname and settings from container configuration
+   for envar in "${env[@]}"
+   do
+     if [[ $envar == DOCKER_USE_HOSTNAME* ]] || [[ $envar == DISCOURSE_HOSTNAME* ]]
+     then
+       # use as environment variable
+       eval $envar
+     fi
+   done
+
    (
      hostname=`hostname`
+     # overwrite hostname
+     if [ "$DOCKER_USE_HOSTNAME" = "true" ]
+     then
+       hostname=$DISCOURSE_HOSTNAME
+     else
+       hostname=$hostname-$config
+     fi
+
      set -x
-     $docker_path run $user_args $links $attach_on_run $restart_policy "${env[@]}" -h "$hostname-$config" \
+     $docker_path run $user_args $links $attach_on_run $restart_policy "${env[@]}" -h "$hostname" \
         -e DOCKER_HOST_IP=$docker_ip --name $config -t $ports $volumes $docker_args $run_image $boot_command
 
    )
@@ -577,7 +595,7 @@ case "$command" in
       ;;
 
   enter)
-      exec $docker_path exec -it $config /bin/bash
+      exec $docker_path exec -it $config /bin/bash --login
       ;;
 
   ssh)
index 9fcc5afa48de669d52be63ffb5598873ec008de9..e45532d925022332973292ad812c4ff2b23677af 100644 (file)
@@ -19,9 +19,14 @@ templates:
   - "templates/web.template.yml"
   - "templates/web.ratelimited.template.yml"
 
+ ## Comment out the following lines if you wish to add Lets Encrypt for your Discourse install
+ # - "templates/web.ssl.template.yml"
+ # - "templates/web.letsencrypt.ssl.template.yml"
+
 ## which TCP/IP ports should this container expose?
 expose:
   - "80:80"   # fwd host port 80   to container port 80 (http)
+  - "443:443" # fwd host port 443   to container port 443 (https) (ssl ready)
 # If you want Discourse to share a port with another webserver like Apache or nginx,
 # see https://meta.discourse.org/t/17247 for instructions.
 
@@ -59,6 +64,10 @@ env:
 
   ## TODO: The domain name this Discourse instance will respond to
   DISCOURSE_HOSTNAME: 'discourse.example.com'
+  ## TODO: Uncomment if you want the container to be started with the same
+  ##       hostname (-h option) as specified above (default "$hostname-$config")
+  ## NOTE: 'true' is the only valid value here, any other will be ignored
+  #DOCKER_USE_HOSTNAME: true
 
   ## TODO: The mailserver this Discourse instance will use
   DISCOURSE_SMTP_ADDRESS: smtp.example.com         # (mandatory)
@@ -66,6 +75,9 @@ env:
   #DISCOURSE_SMTP_USER_NAME: user@example.com      # (optional)
   #DISCOURSE_SMTP_PASSWORD: pa$$word               # (optional, WARNING the char '#' in pw can cause problems!)
   #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
+  
+  ## The Lets Encrypt email will allow you to register a FREE SSL certificate if you added the Lets Encrypt template, comment it out if you have set this up
+  # LETSENCRYPT_ACCOUNT_EMAIL: email@awesomedomain.com
 
   ## The CDN address for this Discourse instance (configured to pull)
   #DISCOURSE_CDN_URL: //discourse-cdn.example.com
index 142fddfc710970c1d191222789325ea4f3790170..35acb5f1cbb1e8624ce78c767534448f473bc7ec 100644 (file)
@@ -42,6 +42,10 @@ env:
   ##
   ## TODO: The domain name this Discourse instance will respond to
   DISCOURSE_HOSTNAME: 'discourse.example.com'
+  ## TODO: Uncomment if you want the container to be started with the same
+  ##       hostname (-h option) as specified above (default "$hostname-$config")
+  ## NOTE: 'true' is the only valid value here, any other will be ignored
+  #DOCKER_USE_HOSTNAME: true
   ##
   ## TODO: The mailserver this Discourse instance will use
   DISCOURSE_SMTP_ADDRESS: smtp.example.com         # (mandatory)
index 5fbe43495b8c227bb8c092928e15ffeb211dfa46..bfd06ce637d0fc6fd6d6dd28aebbc37c8ff7302d 100644 (file)
@@ -247,3 +247,10 @@ run:
           mkdir -p /shared/backups
           chown -R discourse:www-data /shared/backups
         fi
+
+  # change login directory to Discourse home
+  - file:
+     path: /root/.bash_profile
+     chmod: 644
+     contents: |
+        cd $home