diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile new file mode 100644 index 0000000..09046be --- /dev/null +++ b/docker/build/Dockerfile @@ -0,0 +1,28 @@ +## BACKEND ## +# Parent image +FROM debian + +# Creating directories +RUN mkdir /work /src /app +WORKDIR /work + +# Installing Deps +RUN apt update -y +RUN apt install -y wget build-essential libssl-dev pkg-config + +# Downloading Rust Install Script +RUN wget https://sh.rustup.rs -O /tmp/rust.sh +RUN chmod +x /tmp/rust.sh + +# Installing Rust Toolchain +RUN /tmp/rust.sh -y + +# Getting Environment Variable +ENV PROJ_NAME=example + +# Copying Build Script +COPY docker/build/build.sh /bin/build.sh +RUN chmod +x /bin/build.sh + +## RUNTILE ## +CMD ["bash", "/bin/build.sh"] \ No newline at end of file diff --git a/docker/build/build.sh b/docker/build/build.sh new file mode 100644 index 0000000..3e05f0c --- /dev/null +++ b/docker/build/build.sh @@ -0,0 +1,8 @@ +# Copying source code to working directory +cp -r /src/* . + +# Building the app +/root/.cargo/bin/cargo build + +# Copying app to Result Directory +cp target/debug/$PROJ_NAME /app/$PROJ_NAME \ No newline at end of file