Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Asaduzzaman Pavel committed Oct 17, 2018
1 parent 9081de7 commit b593aa2
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
FROM golang:1.9.2
FROM golang:alpine as build
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux

RUN apk add --no-cache make git

WORKDIR /go/src/github.com/netlify/gotrue
COPY . /go/src/github.com/netlify/gotrue/
COPY . /go/src/github.com/netlify/gotrue

RUN ls -al
RUN make deps build
RUN go build -a -installsuffix cgo -o gotrue


FROM alpine:3.7
RUN adduser -D -u 1000 netlify

RUN apk add --no-cache ca-certificates
RUN adduser -D -u 1000 netlify && mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY --from=0 /go/src/github.com/netlify/gotrue/gotrue /usr/local/bin/gotrue
COPY --from=0 /go/src/github.com/netlify/gotrue/migrations /usr/local/etc/gotrue/migrations/
RUN chown netlify:netlify /usr/local/bin/gotrue && chown -R netlify:netlify /usr/local/etc/gotrue
COPY --from=build /go/src/github.com/netlify/gotrue/gotrue /usr/local/bin/gotrue
COPY --from=build /go/src/github.com/netlify/gotrue/migrations /usr/local/etc/gotrue/migrations/

USER netlify
ENV GOTRUE_DB_MIGRATIONS_PATH /usr/local/etc/gotrue/migrations
CMD ["gotrue"]

USER netlify
CMD ["gotrue"]

0 comments on commit b593aa2

Please sign in to comment.