Skip to content

Commit

Permalink
Merge pull request #107 from checkr/zz/change-docker-base
Browse files Browse the repository at this point in the history
Use multi-stage build for dockerfile
  • Loading branch information
zhouzhuojie authored Apr 4, 2018
2 parents 1e7ea8c + 0a188fa commit 459f44c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM checkr/flagr-ci

VOLUME ["/data"]

FROM checkr/flagr-ci as builder
WORKDIR /go/src/github.com/checkr/flagr
ADD . .
ADD ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db
RUN cd ./browser/flagr-ui/ && yarn install && yarn run build
RUN make build

FROM alpine:3.6
RUN apk add --no-cache libc6-compat
WORKDIR /go/src/github.com/checkr/flagr
VOLUME ["/data"]
ADD ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db
ENV FLAGR_DB_DBCONNECTIONSTR=/data/demo_sqlite3.db
ENV FLAGR_RECORDER_ENABLED=false
ENV HOST=0.0.0.0
ENV PORT=18000

RUN cd ./browser/flagr-ui/ && yarn install && yarn run build
RUN make build

COPY --from=builder /go/src/github.com/checkr/flagr/flagr ./flagr
COPY --from=builder /go/src/github.com/checkr/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist
EXPOSE 18000
CMD ./flagr

0 comments on commit 459f44c

Please sign in to comment.