mirror of
https://git.mills.io/prologic/zs-starter-template.git
synced 2024-11-15 16:56:00 -05:00
Update to latest version of zs
This commit is contained in:
parent
e1dc6b0ee3
commit
c53f3f5580
38
Dockerfile
38
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"]
|
||||
|
9
Makefile
9
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
|
||||
|
Loading…
Reference in New Issue
Block a user