mirror of
https://git.mills.io/prologic/zs-starter-template.git
synced 2024-11-22 05:16:04 +03: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
|
# 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"]
|
|
||||||
|
9
Makefile
9
Makefile
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user