diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 35 |
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"] |