forked from oatpp/example-hls-media-stream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (40 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
52 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 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 \
cmake \
g++ \
git \
make \
wget \
curl \
unzip \
libssl-dev \
libcurl4-openssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Add your service code to the container
COPY . /service
# Set the working directory
WORKDIR /service/utility
# Run the installation script for oatpp modules
RUN ./install-oatpp-modules.sh
# Set the build directory
WORKDIR /service/build
# Run cmake and make to build your project
RUN cmake ..
RUN make
# 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
# Set the entrypoint to your C++ service
ENTRYPOINT ["hls-example-exe"]