jojomi/docker-hugo

How to stop hugo from appending :1313 to everything?

kstenerud opened this issue · 2 comments

When I create a site and try to serve it, every link within the site has port 1313 appended to it (it's like this in the actual generated content). I've set HUGO_BASEURL to no avail :/

docker-compose.yml:

version: '3.3'

volumes:
  generated_html:

services:

  web:
    restart: always
    image: nginx
    container_name: ts-web
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - generated_html:/usr/share/nginx/html:ro

  hugo:
    restart: always
    image: jojomi/hugo:latest
    container_name: ts-hugo
    volumes:
      - /home/site/blog:/src
      - generated_html:/output
    environment:
      - HUGO_WATCH=true
      - HUGO_THEME=beg
      - HUGO_BASEURL=redacted.net
azN2 commented

hello,
you need to clone the repo, modifying the run.sh. adding --appendPort=false . then build your own image

if [[ $HUGO_WATCH != 'false' ]]; then
	    echo "Watching..."
        $HUGO server --watch=true --source="/src" --appendPort=false -e="production" --theme="$HUGO_THEME" --destination="$HUGO_DESTINATION" --baseURL="$HUGO_BASEURL" --bind="0.0.0.0" "$@" || exit 1

+1 on this issue, would make sense to at least include it in an environment variable! It's a bit painful to clone the entire image for such a minor (but site-breaking) issue.