Created Docker Env for building

This commit is contained in:
Maddox Werts 2025-02-10 10:22:21 -05:00
parent 5366ca8412
commit 12d8abfd07
2 changed files with 36 additions and 0 deletions

28
docker/build/Dockerfile Normal file
View file

@ -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"]

8
docker/build/build.sh Normal file
View file

@ -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