Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ahemdboudarbala authored Aug 14, 2024
1 parent 658e695 commit 52f0d00
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand All @@ -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"]

0 comments on commit 52f0d00

Please sign in to comment.