Update to latest version of zs

This commit is contained in:
James Mills 2023-03-12 17:44:34 +10:00
parent e1dc6b0ee3
commit c53f3f5580
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
3 changed files with 6 additions and 43 deletions

View File

@ -1,49 +1,17 @@
# Build # Build
FROM golang:alpine AS build FROM prologic/zs AS build
ENV CGO_ENABLED=0
RUN apk add --no-cache -U build-base git make
RUN mkdir -p /src RUN mkdir -p /src
WORKDIR /src WORKDIR /src
# Copy Makefile
COPY Makefile ./
# Install deps
RUN make deps
# Copy content # Copy content
COPY . . COPY . .
# Build the site # Build the site
RUN make build RUN zs build
# Runtime # 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 --from=build /src/.pub /data
COPY .dockerfiles/entrypoint.sh /init
ENTRYPOINT ["/init"]
CMD ["static", "-n", "-s", "-r", "/data"]

View File

@ -7,16 +7,11 @@ TAG := latest
all: build all: build
deps: deps:
@$(GOCMD) install git.mills.io/prologic/zs@latest @$(GOCMD) install go.mills.io/zs@latest
@$(GOCMD) install git.mills.io/prologic/static@latest
dev : DEBUG=1 dev : DEBUG=1
dev : build dev : build
@bash -c 'trap "jobs -p | xargs kill" EXIT; \ @zs serve
zs watch & \
static -r .pub & \
echo http://localhost:8000/; \
wait'
build: build:
@zs build @zs build

View File

@ -29,4 +29,4 @@ A demo of this starter template can be found here: https://zs.mills.io/
## License ## License
`zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE) `zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE)