diff --git a/Dockerfile b/Dockerfile index f886ec6..5cfb6bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,17 @@ FROM golang:1.16-alpine3.13 as build RUN apk add --no-cache git gcc musl-dev sqlite-dev -ADD *.go /app/ -ADD go.mod /app/ -ADD go.sum /app/ WORKDIR /app +ADD *.go go.mod go.sum /app/ RUN go build --tags "libsqlite3 linux sqlite_fts5" FROM alpine:3.13 RUN apk add --no-cache sqlite-dev tzdata tor COPY templates/ /app/templates/ -COPY --from=build /app/GoBlog /bin/ WORKDIR /app VOLUME /app/config VOLUME /app/data EXPOSE 80 EXPOSE 443 EXPOSE 8080 -CMD ["GoBlog"] \ No newline at end of file +CMD ["GoBlog"] +COPY --from=build /app/GoBlog /bin/ \ No newline at end of file diff --git a/http.go b/http.go index 62a2817..4e9e592 100644 --- a/http.go +++ b/http.go @@ -50,6 +50,7 @@ func startServer() (err error) { finalHandler = securityHeaders(finalHandler) } finalHandler = servertiming.Middleware(finalHandler, nil) + finalHandler = middleware.Heartbeat("/ping")(finalHandler) finalHandler = middleware.Compress(flate.DefaultCompression)(finalHandler) finalHandler = middleware.Recoverer(finalHandler) if appConfig.Server.Logging {