From c53f3f55803f7771c3c6336836d8ffdf13b66852 Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Sun, 12 Mar 2023 17:44:34 +1000 Subject: [PATCH] Update to latest version of zs --- Dockerfile | 38 +++----------------------------------- Makefile | 9 ++------- index.md | 2 +- 3 files changed, 6 insertions(+), 43 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce19e0e..3a1085e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,49 +1,17 @@ # Build -FROM golang:alpine AS build - -ENV CGO_ENABLED=0 - -RUN apk add --no-cache -U build-base git make +FROM prologic/zs AS build RUN mkdir -p /src WORKDIR /src -# Copy Makefile -COPY Makefile ./ - -# Install deps -RUN make deps - # Copy content COPY . . # Build the site -RUN make build +RUN zs build # Runtime -FROM alpine AS runtime +FROM prologic/zs AS runtime -RUN apk --no-cache -U add su-exec shadow - -ENV PUID=10000 -ENV PGID=10000 - -RUN addgroup -g "${PGID}" zs && \ - adduser -D -H -G zs -h /var/empty -u "${PUID}" zs && \ - mkdir -p /data && chown -R zs:zs /data - -EXPOSE 8000 - -VOLUME /data - -WORKDIR / - -COPY --from=build /go/bin/static /usr/local/bin/static COPY --from=build /src/.pub /data - -COPY .dockerfiles/entrypoint.sh /init - -ENTRYPOINT ["/init"] - -CMD ["static", "-n", "-s", "-r", "/data"] diff --git a/Makefile b/Makefile index 40a1463..5ee51d9 100644 --- a/Makefile +++ b/Makefile @@ -7,16 +7,11 @@ TAG := latest all: build deps: - @$(GOCMD) install git.mills.io/prologic/zs@latest - @$(GOCMD) install git.mills.io/prologic/static@latest + @$(GOCMD) install go.mills.io/zs@latest dev : DEBUG=1 dev : build - @bash -c 'trap "jobs -p | xargs kill" EXIT; \ - zs watch & \ - static -r .pub & \ - echo http://localhost:8000/; \ - wait' + @zs serve build: @zs build diff --git a/index.md b/index.md index 1df9984..b760198 100644 --- a/index.md +++ b/index.md @@ -29,4 +29,4 @@ A demo of this starter template can be found here: https://zs.mills.io/ ## License -`zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE) \ No newline at end of file +`zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE)