2 changed files with 43 additions and 0 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
FROM golang:alpine as builder |
||||
|
||||
WORKDIR /lexis |
||||
|
||||
COPY lexis.go . |
||||
|
||||
RUN apk add --no-cache git |
||||
|
||||
RUN go get github.com/PuerkitoBio/goquery |
||||
RUN go get github.com/gorilla/mux |
||||
RUN go build lexis.go |
||||
|
||||
#---------------------------------- |
||||
|
||||
FROM alpine:edge |
||||
|
||||
ENV PORT 9000 |
||||
|
||||
ENV service_user="lexis" |
||||
|
||||
RUN addgroup -S ${service_user} && adduser -S ${service_user} -G ${service_user} |
||||
|
||||
RUN mkdir -p /lexis && chown -R ${service_user}:${service_user} /lexis |
||||
|
||||
WORKDIR /lexis |
||||
|
||||
USER "$service_user" |
||||
|
||||
COPY web web |
||||
COPY --from=builder /lexis/lexis . |
||||
|
||||
EXPOSE $PORT |
||||
|
||||
ENTRYPOINT ./lexis -serve -port "${PORT}" |
||||
|
Loading…
Reference in new issue