From 4501be6a43981fc50ffc7bf92eb0f5776d9e30e1 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sun, 16 Oct 2022 14:36:57 +0200 Subject: [PATCH] Create docker image for release --- rust/Dockerfile | 6 ++++++ rust/build_docker_image.sh | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 rust/Dockerfile create mode 100755 rust/build_docker_image.sh diff --git a/rust/Dockerfile b/rust/Dockerfile new file mode 100644 index 0000000..e03246e --- /dev/null +++ b/rust/Dockerfile @@ -0,0 +1,6 @@ +FROM debian:bullseye-slim + +COPY sea_battle_backend /usr/local/bin/sea_battle_backend + +ENTRYPOINT /usr/local/bin/sea_battle_backend + diff --git a/rust/build_docker_image.sh b/rust/build_docker_image.sh new file mode 100755 index 0000000..401d83b --- /dev/null +++ b/rust/build_docker_image.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cargo build --release --bins + +TEMP_DIR=$(mktemp -d) +cp target/release/sea_battle_backend "$TEMP_DIR" + +docker build -f Dockerfile "$TEMP_DIR" -t pierre42100/seabattleapi + +rm -r $TEMP_DIR +