Repository navigation
Expand file tree
/
Copy pathDockerfile.server
More file actions
75 lines (61 loc) · 2.13 KB
/
Copy pathDockerfile.server
File metadata and controls
75 lines (61 loc) · 2.13 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools and system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
g++ \
cmake \
make \
git \
wget \
pkg-config \
libmysqlclient-dev \
mysql-client \
libmysqlcppconn-dev \
nlohmann-json3-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Boost (includes Beast + ASIO)
RUN apt-get update && apt-get install -y \
libboost-all-dev \
&& rm -rf /var/lib/apt/lists/*,
# Install Crow (header-only library)
# RUN git clone --depth 1 https://github.com/CrowCpp/Crow.git /tmp/crow && \
# mkdir -p /usr/local/include && \
# cp -r /tmp/crow/include/* /usr/local/include/ && \
# rm -rf /tmp/crow
# libbcrypt — no official releases/tags available
# Pinned commit reference: d6523c370de6e724ce4ec703e2449b5b028ea3b1 (June 22, 2021)
# If this breaks, check that commit on https://github.com/trusch/libbcrypt
RUN git clone --depth 1 https://github.com/trusch/libbcrypt.git /tmp/libbcrypt && \
cd /tmp/libbcrypt && \
mkdir build && cd build && \
cmake .. && make && make install && \
ldconfig && \
rm -rf /tmp/libbcrypt
# Crow — targeting the v1.3.0 tag
RUN git clone --depth 1 --branch v1.3.0 https://github.com/CrowCpp/Crow.git /tmp/crow && \
mkdir -p /usr/local/include && \
cp -r /tmp/crow/include/* /usr/local/include/ && \
rm -rf /tmp/crow
# Install JWT-cpp (header only library)
RUN cd /tmp && \
git clone --depth 1 --branch v0.7.0 https://github.com/Thalhammer/jwt-cpp.git && \
cp -r jwt-cpp/include/jwt-cpp /usr/local/include/ && \
rm -rf /tmp/jwt-cpp
# Install doctest for testing
# RUN wget -O /usr/local/include/doctest.h \
# https://raw.githubusercontent.com/doctest/doctest/master/doctest/doctest.h
RUN apt-get update && apt-get install -y \
libgtest-dev \
libgmock-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy source code
COPY server ./server
COPY common ./common
COPY tests ./tests
# Copy and prepare build script
# COPY build-server.sh ./build-server.sh
RUN chmod +x ./server/build-server.sh
CMD ["/bin/bash"]