Add Dockerfile

This commit is contained in:
Jan-Lukas Else 2020-09-24 19:04:28 +02:00
parent ee02d0e03b
commit b33d7ff93e
1 changed files with 19 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -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"]