-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
52 lines (39 loc) · 977 Bytes
/
Dockerfile
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
# Copyright (c) 2018-2024 Ken Barker
FROM alpine:3.19 AS build
LABEL maintainer="[email protected]"
# Load build packages
RUN apk --update add --no-cache \
build-base \
cmake \
boost boost-dev \
openssl openssl-dev
WORKDIR /opt
COPY . via-httplib
WORKDIR /opt/via-httplib
# Build the via-httplib library
RUN mkdir build \
&& cd build \
&& cmake \
-DVIA_HTTPLIB_UNIT_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
.. \
&& make \
&& make install \
&& rm -fr *
WORKDIR /opt/via-httplib/build
# Build an via-httplib server
RUN cmake \
-DCMAKE_BUILD_TYPE=Release \
../examples/server \
&& make
# Create a clean alpine image and copy the server to it
FROM alpine:3.19
RUN apk --update add --no-cache \
openssl \
boost-system \
boost-date_time \
boost-regex
COPY --from=build /opt/via-httplib/build/HttpServer /bin/HttpServer
# Start the server on entry
ENTRYPOINT ["/bin/HttpServer"]