multimodal-routing/Dockerfile

33 lines
916 B
Docker

FROM git.coopgo.io/coopgo-platform/libvalhalla-go:main AS builder
# Install Golang
RUN curl -LO https://go.dev/dl/go1.23.4.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
ARG ACCESS_TOKEN_USR="nothing"
ARG ACCESS_TOKEN_PWD="nothing"
RUN printf "machine git.coopgo.io\n\
login ${ACCESS_TOKEN_USR}\n\
password ${ACCESS_TOKEN_PWD}\n"\
>> ~/.netrc
RUN chmod 600 ~/.netrc
RUN ls .
COPY . .
ENV PATH=$PATH:/usr/local/go/bin
RUN go mod download & CGO_ENABLED=1 go build -o /server
#RUN go build -a -ldflags "-linkmode external -extldflags '-static' -s -w" -o /server
#RUN go mod download & CGO_ENABLED=1 GOOS=linux go build -x -ldflags '-extldflags "-L/usr/local/lib/"' -o /server
FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /usr/local/lib/libvalhalla-go.so /usr/local/lib
COPY --from=builder /server /
EXPOSE 8080
ENTRYPOINT ["/server"]