From 99c692e5f89545aeb1f3f8608c17f02b49c0e0a3 Mon Sep 17 00:00:00 2001 From: Christian Fosli Date: Sun, 31 Mar 2024 21:55:50 +0200 Subject: [PATCH] chore: Show drafts when running locally, support `docker compose watch` * Show drafts when running locally * Support using `docker compose watch` to automatically rebuild when content changes --- Dockerfile | 3 ++- docker-compose.yaml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 266dae2..9c23348 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ FROM ghcr.io/getzola/zola:v0.18.0 as zola ARG BASE_URL="https://www.christianfosli.com" +ARG DRAFTS="0" COPY . /project COPY --from=busybox:1-uclibc /bin/sh /bin/ WORKDIR /project -RUN zola build --base-url $BASE_URL +RUN zola build --base-url $BASE_URL $([ "$DRAFTS" = 1 ] && echo "--drafts" || echo "") FROM ghcr.io/static-web-server/static-web-server:2 WORKDIR / diff --git a/docker-compose.yaml b/docker-compose.yaml index 9fc1bda..567caa0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,5 +4,10 @@ services: context: . args: BASE_URL: "http://localhost:8000" + DRAFTS: "1" + develop: + watch: + - path: . + action: rebuild ports: - "8000:80"