diff --git a/.gitignore b/.gitignore index 3cd22ee..e5f9f41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.env inc/public inc/resources inc/.hugo_build.lock diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e628895 --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +source .env + +[ -z $PUBLIC_URL ] && PUBLIC_URL="https://example.com" + +echo "Bulding public site: "$PUBLIC_URL + +cd inc +git submodule update --init + +cd .. +docker-compose build +docker-compose run hugo build -b $PUBLIC_URL diff --git a/docker-compose.yml b/docker-compose.yml index d0940e1..245fa86 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,10 @@ services: build: context: . args: - - HUGO_HOST=docker - - HUGO_PORT=1313 + - HUGO_HOST=${HUGO_HOST} + - HUGO_PORT=${HUGO_PORT} ports: - - 1313:1313 - user: 1000:1000 + - ${HUGO_PORT}:1313 + user: ${USER_GROUP} volumes: - ./inc:/app diff --git a/env.sample b/env.sample new file mode 100644 index 0000000..a5a9227 --- /dev/null +++ b/env.sample @@ -0,0 +1,4 @@ +PUBLIC_URL=http://example.com +HUGO_HOST=docker +HUGO_PORT=1313 +USER_GROUP=1000:1000