summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2019-03-14 19:55:09 -0500
committerStuart Stock <stuart@int08h.com>2019-03-14 19:56:29 -0500
commit1a87df0f20a5a0a267b5be461d5823eba48ac160 (patch)
tree565e557b04ee08e1ad78d9992d630096f0089ffb
parent384194278089fe658fdb3b03032e5b63e6d81e3f (diff)
downloadroughenough-1a87df0f20a5a0a267b5be461d5823eba48ac160.zip
Adds a Dockerfile to build and run a roughenough server in a container
-rw-r--r--Dockerfile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..8f84fc8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,35 @@
+#
+# Example multi-stage docker build for running a Roughenough server
+#
+
+# Stage 1: build
+
+FROM rust:1.33 AS stage1
+
+ARG ROUGHENOUGH_RELEASE=1.1.4
+ARG ROUGHENOUGH_FEATURES="default"
+
+# Uncomment and replace above if you want KMS support
+#ARG ROUGHENOUGH_FEATURES="awskms"
+#ARG ROUGHENOUGH_FEATURES="gcpkms"
+
+RUN git clone -b ${ROUGHENOUGH_RELEASE} https://github.com/int08h/roughenough.git \
+ && cd /roughenough \
+ && cargo build --release --features ${ROUGHENOUGH_FEATURES}
+
+# Stage 2: runtime image
+
+FROM gcr.io/distroless/cc
+
+WORKDIR /roughenough
+
+COPY --from=stage1 /roughenough/target/release/roughenough-server /roughenough
+COPY roughenough.cfg /roughenough
+COPY creds.json /roughenough
+
+ENV RUST_BACKTRACE 1
+ENV GOOGLE_APPLICATION_CREDENTIALS /roughenough/creds.json
+
+EXPOSE 2002/udp
+
+CMD ["/roughenough/roughenough-server", "/roughenough/roughenough.cfg"]