From b33d7ff93ebf6c112182c7ad2d860a95d7238025 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Thu, 24 Sep 2020 19:04:28 +0200 Subject: [PATCH] Add Dockerfile --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6dd509b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.15-alpine3.12 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 +RUN go build --tags "libsqlite3 linux" + +FROM alpine:3.12 +RUN apk add --no-cache sqlite-dev +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