decred.org/dcrdex@v1.0.3/client/Dockerfile (about) 1 # 2 # Build the docker image 3 # $ docker build -t user/bisonw -f client/Dockerfile . 4 # 5 # Create docker volume to store client data 6 # $ docker volume create --name=bisonw_data 7 # 8 # Run the docker image, mapping web access port. 9 # $ docker run -d --rm -p 127.0.0.1:5758:5758 -v bisonw_data:/dex/.dexc user/bisonw 10 # 11 12 # frontend build 13 14 # The image below is node:current-alpine3.18 (linux/amd64) 15 # It's pulled by the digest (immutable id) to avoid supply-chain attacks. 16 # Maintainer Note: 17 # To update to a new digest, you must first manually pull the new image: 18 # `docker pull node:<new version>` 19 # Docker will print the digest of the new image after the pull has finished. 20 FROM node@sha256:d75175d449921d06250afd87d51f39a74fc174789fa3c50eba0d3b18369cc749 AS nodebuilder 21 WORKDIR /root/dex 22 COPY . . 23 RUN apk add git 24 WORKDIR /root/dex/client/webserver/site/ 25 RUN npm clean-install 26 RUN npm run build 27 28 # bisonw binary build 29 30 # The image below is golang:1.21.0-alpine3.18 (linux/amd64) 31 # It's pulled by the digest (immutable id) to avoid supply-chain attacks. 32 # Maintainer Note: 33 # To update to a new digest, you must first manually pull the new image: 34 # `docker pull golang:<new version>` 35 # Docker will print the digest of the new image after the pull has finished. 36 FROM golang@sha256:445f34008a77b0b98bf1821bf7ef5e37bb63cc42d22ee7c21cc17041070d134f AS gobuilder 37 COPY --from=nodebuilder /root/dex/ /root/dex/ 38 WORKDIR /root/dex/client/cmd/bisonw/ 39 RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build 40 WORKDIR /root/dex/client/cmd/bwctl/ 41 RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build 42 43 # Final image 44 FROM debian:buster-slim 45 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates 46 WORKDIR /dex 47 ENV HOME /dex 48 RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc 49 USER 1000 50 COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./ 51 COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./ 52 EXPOSE 5758 53 CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]