github.com/prebid/prebid-server/v2@v2.18.0/Dockerfile (about) 1 FROM ubuntu:20.04 AS build 2 RUN apt-get update && \ 3 apt-get -y upgrade && \ 4 apt-get install -y wget 5 WORKDIR /tmp 6 RUN wget https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz && \ 7 tar -xf go1.20.5.linux-amd64.tar.gz && \ 8 mv go /usr/local 9 RUN mkdir -p /app/prebid-server/ 10 WORKDIR /app/prebid-server/ 11 ENV GOROOT=/usr/local/go 12 ENV PATH=$GOROOT/bin:$PATH 13 ENV GOPROXY="https://proxy.golang.org" 14 RUN apt-get update && \ 15 apt-get install -y git && \ 16 apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 17 ENV CGO_ENABLED 0 18 COPY ./ ./ 19 RUN go mod tidy 20 RUN go mod vendor 21 ARG TEST="true" 22 RUN if [ "$TEST" != "false" ]; then ./validate.sh ; fi 23 RUN go build -mod=vendor -ldflags "-X github.com/prebid/prebid-server/v2/version.Ver=`git describe --tags | sed 's/^v//'` -X github.com/prebid/prebid-server/v2/version.Rev=`git rev-parse HEAD`" . 24 25 FROM ubuntu:20.04 AS release 26 LABEL maintainer="hans.hjort@xandr.com" 27 WORKDIR /usr/local/bin/ 28 COPY --from=build /app/prebid-server . 29 RUN chmod a+xr prebid-server 30 COPY static static/ 31 COPY stored_requests/data stored_requests/data 32 RUN chmod -R a+r static/ stored_requests/data 33 RUN apt-get update && \ 34 apt-get install -y ca-certificates mtr && \ 35 apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 36 RUN adduser prebid_user 37 USER prebid_user 38 EXPOSE 8000 39 EXPOSE 6060 40 ENTRYPOINT ["/usr/local/bin/prebid-server"] 41 CMD ["-v", "1", "-logtostderr"]