-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (36 loc) · 1.16 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (36 loc) · 1.16 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
FROM ubuntu:24.04 AS builder
ARG DEBIAN_FRONTEND=noninteractive
ARG CROW_VERSION=v1.3.0
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
ca-certificates \
libasio-dev \
libssl-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Crow
RUN git clone --branch "${CROW_VERSION}" --depth 1 \
https://github.com/CrowCpp/Crow.git /tmp/crow \
&& cmake -S /tmp/crow -B /tmp/crow/build \
-DCROW_BUILD_EXAMPLES=OFF \
-DCROW_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
&& cmake --build /tmp/crow/build --parallel \
&& cmake --install /tmp/crow/build
WORKDIR /app
COPY CMakeLists.txt .
COPY src/ src/
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel
FROM ubuntu:24.04 AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl3t64 \
zlib1g \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --system --uid 10001 --no-create-home appuser
COPY --from=builder /app/build/crow_server /usr/local/bin/crow_server
USER appuser
EXPOSE 9091
ENTRYPOINT ["/usr/local/bin/crow_server"]