2023-01-14 15:25:56 +00:00
|
|
|
FROM golang:1.19-alpine3.17 as buildbase
|
2021-12-06 19:06:26 +00:00
|
|
|
|
2020-09-24 17:04:28 +00:00
|
|
|
WORKDIR /app
|
2022-03-25 15:45:51 +00:00
|
|
|
RUN apk add --no-cache git gcc musl-dev
|
2021-04-14 20:07:37 +00:00
|
|
|
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main sqlite-dev
|
2021-06-11 13:27:42 +00:00
|
|
|
ENV GOFLAGS="-tags=linux,libsqlite3,sqlite_fts5"
|
2021-06-18 13:33:08 +00:00
|
|
|
ADD *.go go.mod go.sum /app/
|
|
|
|
ADD pkgs/ /app/pkgs/
|
|
|
|
ADD testdata/ /app/testdata/
|
2021-07-19 16:44:51 +00:00
|
|
|
ADD templates/ /app/templates/
|
|
|
|
ADD leaflet/ /app/leaflet/
|
2022-05-27 07:48:57 +00:00
|
|
|
ADD hlsjs/ /app/hlsjs/
|
2021-07-23 09:29:03 +00:00
|
|
|
ADD dbmigrations/ /app/dbmigrations/
|
2022-02-11 09:48:33 +00:00
|
|
|
ADD strings/ /app/strings/
|
2022-08-09 15:25:22 +00:00
|
|
|
ADD plugins/ /app/plugins/
|
2022-11-27 14:08:48 +00:00
|
|
|
ADD logo/GoBlog.png /app/logo/GoBlog.png
|
2021-12-28 11:50:40 +00:00
|
|
|
|
|
|
|
FROM buildbase as build
|
|
|
|
|
2022-10-22 18:29:45 +00:00
|
|
|
RUN go build -ldflags '-w -s' -o GoBlog
|
2020-09-24 17:04:28 +00:00
|
|
|
|
2022-04-16 04:22:14 +00:00
|
|
|
FROM build as test
|
|
|
|
|
2022-07-17 06:36:10 +00:00
|
|
|
RUN go test -timeout 300s -failfast -cover ./...
|
2022-04-16 04:22:14 +00:00
|
|
|
|
2023-01-14 15:25:56 +00:00
|
|
|
FROM alpine:3.17 as base
|
2021-12-06 19:06:26 +00:00
|
|
|
|
2020-09-24 17:04:28 +00:00
|
|
|
WORKDIR /app
|
|
|
|
VOLUME /app/config
|
|
|
|
VOLUME /app/data
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 443
|
|
|
|
EXPOSE 8080
|
2021-03-22 09:25:43 +00:00
|
|
|
CMD ["GoBlog"]
|
2021-04-11 14:08:29 +00:00
|
|
|
HEALTHCHECK --interval=1m --timeout=10s CMD GoBlog healthcheck
|
2022-08-05 07:43:36 +00:00
|
|
|
ENV GOMEMLIMIT=100MiB
|
2022-03-25 15:45:51 +00:00
|
|
|
RUN apk add --no-cache tzdata tor
|
2021-04-14 20:07:37 +00:00
|
|
|
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main sqlite-dev
|
2021-04-11 14:08:29 +00:00
|
|
|
COPY templates/ /app/templates/
|
2021-12-06 19:06:26 +00:00
|
|
|
COPY --from=build /app/GoBlog /bin/
|
|
|
|
|
|
|
|
FROM base as tools
|
|
|
|
|
|
|
|
RUN apk add --no-cache curl bash git
|
|
|
|
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main sqlite
|