From 52f0d00476b98aed78af13c3c35f8a712ce047b2 Mon Sep 17 00:00:00 2001 From: boudarbalaahmed Date: Wed, 14 Aug 2024 10:52:57 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a75cd3..dfe8dd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ -# Use Ubuntu 24.04 as the base image -FROM ubuntu:24.04 +# Step 1: Build the Jekyll site +FROM jekyll/jekyll:4.2.0 AS jekyll-build +WORKDIR /srv/jekyll +COPY . . +RUN jekyll build + +# Step 2: Build your C++ service +FROM ubuntu:24.04 AS service-build # Install necessary dependencies RUN apt-get update && apt-get install -y \ @@ -15,7 +21,7 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Add your service code to the container -ADD . /service +COPY . /service # Set the working directory WORKDIR /service/utility @@ -30,8 +36,17 @@ WORKDIR /service/build RUN cmake .. RUN make -# Expose the required port(s) -EXPOSE 8000 8000 +# Step 3: Create the final container that combines the Jekyll site and your service +FROM ubuntu:24.04 + +# Copy the built Jekyll site from the first stage +COPY --from=jekyll-build /srv/jekyll/_site /srv/jekyll/_site + +# Copy the built service executable from the second stage +COPY --from=service-build /service/build/hls-example-exe /usr/local/bin/hls-example-exe + +# Expose the necessary port +EXPOSE 8000 -# Define the entrypoint -ENTRYPOINT ["./hls-example-exe"] +# Set the entrypoint to your C++ service +ENTRYPOINT ["hls-example-exe"]