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
)
;;
enter)
- exec $docker_path exec -it $config /bin/bash
+ exec $docker_path exec -it $config /bin/bash --login
;;
ssh)
- "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.
## 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)
#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
##
## 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)