2021-12-28 11:50:40 +00:00
|
|
|
FROM golang:1.17-alpine3.15 as buildbase
|
2021-12-06 19:06:26 +00:00
|
|
|
|
2020-09-24 17:04:28 +00:00
|
|
|
WORKDIR /app
|
2021-04-14 19:59:40 +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/
|
2021-07-23 09:29:03 +00:00
|
|
|
ADD dbmigrations/ /app/dbmigrations/
|
2021-12-28 11:50:40 +00:00
|
|
|
|
|
|
|
FROM buildbase as build
|
|
|
|
|
2021-06-16 09:55:57 +00:00
|
|
|
RUN go build -ldflags '-w -s' -o GoBlog
|
2020-09-24 17:04:28 +00:00
|
|
|
|
2021-12-28 11:54:08 +00:00
|
|
|
FROM build as test
|
|
|
|
|
|
|
|
RUN go test -cover ./...
|
|
|
|
|
2021-12-06 19:06:26 +00:00
|
|
|
FROM alpine:3.15 as base
|
|
|
|
|
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
|
2021-04-14 19:59:40 +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
|