jlelse
/
kis3
Archived
1
Fork 0

Update Dockerfile

This commit is contained in:
Jan-Lukas Else 2020-04-01 16:45:36 +02:00
parent de134f5e10
commit a45170a378
1 changed files with 7 additions and 12 deletions

View File

@ -1,25 +1,20 @@
FROM alpine:edge as build-base
RUN apk add --no-cache go git gcc musl-dev tzdata
FROM build-base as packr
FROM golang:1.14-alpine as build
RUN apk add --no-cache git gcc musl-dev tzdata sqlite-dev
RUN go get github.com/gobuffalo/packr/v2/packr2
FROM build-base as build
COPY --from=packr /root/go/bin/packr2 /bin/
ADD . /app
WORKDIR /app
RUN GO111MODULE=on packr2
RUN go test
RUN go build github.com/kis3/kis3
RUN packr2
RUN go test --tags "libsqlite3 linux"
RUN go build --tags "libsqlite3 linux"
FROM alpine:3.11
RUN apk add --no-cache tzdata ca-certificates && update-ca-certificates
RUN apk add --no-cache tzdata sqlite-dev ca-certificates
RUN adduser -S -D -H -h /app kis3
COPY --from=build /app/kis3 /bin/
RUN mkdir /app && chown -R kis3 /app
USER kis3
WORKDIR /app
RUN mkdir data
VOLUME ["/app/data"]
VOLUME /app/data
EXPOSE 8080
CMD ["kis3"]