From 49535b94c44c187b3e630e174309a68c7d76b140 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 29 Jun 2022 17:52:39 -0400 Subject: [PATCH] Create simple dockerfile --- .dockerignore | 1 + .gitignore | 10 +++++----- dockerfile | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 120000 .dockerignore create mode 100644 dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 120000 index 0000000..3e4e48b --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.gitignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8246e27..51f93e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -/target -.vscode +**/target +**/.vscode # Debug related directories that we don't want included -/torrents* -/output -config.toml \ No newline at end of file +**/torrents* +**/output +**/config.toml \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..be07740 --- /dev/null +++ b/dockerfile @@ -0,0 +1,20 @@ +FROM rust:alpine + +ENV USER=cross-seed +ENV GROUP=cross-seed +ENV UID=1000 +ENV GID=1000 + +# Add user + +RUN addgroup -g $GID $GROUP && \ + adduser -D -u $UID --ingroup "$GROUP" "$USER" + +RUN apk add --no-cache musl-dev openssl-dev + +COPY --chown=UID:GID ./ /app +WORKDIR /app +RUN cargo install --path . + +USER $USER +ENTRYPOINT [ "cross-seed" ] \ No newline at end of file