From 53c435881ed2c7a55b7eec1b735301722c915927 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 24 Aug 2023 16:10:53 +0200 Subject: [PATCH] Generate Docker image for backend --- geneit_backend/Dockerfile | 9 +++++++++ geneit_backend/build_docker_image.sh | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 geneit_backend/Dockerfile create mode 100755 geneit_backend/build_docker_image.sh diff --git a/geneit_backend/Dockerfile b/geneit_backend/Dockerfile new file mode 100644 index 0000000..50e56df --- /dev/null +++ b/geneit_backend/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:bullseye-slim + +RUN apt-get update \ + && apt-get install -y libcurl4 \ + && rm -rf /var/lib/apt/lists/* + +COPY geneit_backend /usr/local/bin/geneit_backend + +ENTRYPOINT /usr/local/bin/geneit_backend diff --git a/geneit_backend/build_docker_image.sh b/geneit_backend/build_docker_image.sh new file mode 100755 index 0000000..f3f95ec --- /dev/null +++ b/geneit_backend/build_docker_image.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cargo build --release + +TEMP_DIR=$(mktemp -d) +cp target/release/geneit_backend "$TEMP_DIR" + +docker build -f Dockerfile "$TEMP_DIR" -t pierre42100/geneit_backend + +rm -r $TEMP_DIR +