From 028b1e90c92643c0e146455bec7392481ce22f1d Mon Sep 17 00:00:00 2001 From: nolim1t Date: Wed, 19 Aug 2020 18:06:06 +0700 Subject: [PATCH] First commit --- Dockerfile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..faba41b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +ARG VERSION=v0.6.1 +ARG REPO=https://github.com/cryptoadvance/specter-desktop +ARG USER=specter +ARG DIR=/data/ + +FROM python:3.8.5-slim-buster AS builder + +ARG VERSION +ARG REPO + +RUN apt update && apt install -y git build-essential libusb-1.0-0-dev libudev-dev + +WORKDIR / + +RUN git clone $REPO + +WORKDIR /specter-desktop + +RUN git checkout $VERSION +RUN sed -i "s/vx.y.z-get-replaced-by-release-script/${VERSION}/g; " setup.py +RUN python setup.py install + + +FROM python:3.8.5-slim-buster as final + +ARG USER +ARG DIR + +LABEL maintainer="nolim1t (hello@nolim1t.co)" + +RUN apt update && apt install -y libusb-1.0-0-dev libudev-dev + +# NOTE: Default GID == UID == 1000 +RUN adduser --disabled-password \ + --home "$DIR" \ + --gecos "" \ + "$USER" + +# Set user +USER $USER + +# Make config directory +RUN mkdir -p "$DIR/.specter/" + + +# Copy over python stuff +COPY --from=builder /usr/local/lib/python3.8 /usr/local/lib/python3.8 +COPY --from=builder /usr/local/bin /usr/local/bin + +# Expose ports +EXPOSE 25441 25442 25443 + +ENTRYPOINT ["/usr/bin/python3", "-m", "cryptoadvance.specter", "server"]