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
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"]

View File

@ -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

View File

@ -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)
`zs-starter-template` is licensed under the terms of the [WTFPL License](/LICENSE)