From bb04227f7b977c56ee23fbd71afeeb513f050a37 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 3 Oct 2020 04:10:33 +0100 Subject: [PATCH] Run Hugo as user "hugo" in local dev container When previewing locally using "make container-serve", run the Hugo process as user "hugo" inside that container. --- Dockerfile | 2 ++ Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3e3335076c..4ceae22959 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,4 +29,6 @@ RUN mkdir -p /usr/local/src && \ WORKDIR /src +USER hugo:hugo + EXPOSE 1313 diff --git a/Makefile b/Makefile index 56ec8410f4..523775cd17 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ container-build: module-check $(CONTAINER_RUN) $(CONTAINER_IMAGE) hugo --minify container-serve: module-check - $(CONTAINER_RUN) --mount type=tmpfs,destination=/src/resources,tmpfs-mode=0755 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 + $(CONTAINER_RUN) --mount type=tmpfs,destination=/src/resources,tmpfs-mode=0777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 test-examples: scripts/test_examples.sh install