diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 3bca508..62e76b9 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,4 +1,10 @@ -FROM alpine:3.18 +FROM harbor.fizz.buzz/private/natter:latest AS builder + +COPY . /source +RUN ls /source/ +RUN natter build --config /source/natter.toml + +FROM alpine:3.18 AS server RUN apk add --no-cache bash nginx RUN addgroup web && adduser -D -G web web && install -d -D -o web -g web -m 700 /srv/http/public @@ -6,6 +12,6 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/ COPY --chown=web:web docker/server/nginx.conf /srv/http COPY --chown=web:web docker/server/headers.include /srv/http -COPY --chown=web:web static/ /srv/http/public/ +COPY --from=builder --chown=web:web /source/output/ /srv/http/public/ ENTRYPOINT ["/usr/sbin/nginx", "-c", "/srv/http/nginx.conf", "-e", "stderr", "-g", "daemon off;"] diff --git a/docker/server/Makefile b/docker/server/Makefile index 3bac958..539f791 100644 --- a/docker/server/Makefile +++ b/docker/server/Makefile @@ -42,6 +42,7 @@ else endif .PHONY: run +run: build run: ## Launch the docker image > docker run --rm -i -t -p "8080:8080" $(IMAGE_NAME) diff --git a/natter.toml b/natter.toml new file mode 100644 index 0000000..868f4c2 --- /dev/null +++ b/natter.toml @@ -0,0 +1 @@ +site_title = "FizzBuzz Blog"