-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (58 loc) · 1.99 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Start with apache server
FROM ubuntu:focal
# Install JUST WGET
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install g++ make wget libssl-dev cmake
# Get a recent version cmake
#WORKDIR /opt
#RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz
#RUN tar -xf cmake-3.22.1.tar.gz
# Build the package
# RUN ./bootstrap --parallel=8
#WORKDIR /opt/cmake-3.22.1
#RUN mkdir build
#WORKDIR /opt/cmake-3.22.1/build
#RUN cmake ..
#RUN make -j8
#RUN make install
RUN apt-get -y install zlib1g-dev curl libcurl4 libcurl4-openssl-dev git
# Install aws sdk
WORKDIR /opt
RUN git clone --recurse-submodules -b 1.9.220 https://github.com/aws/aws-sdk-cpp.git
WORKDIR /opt/aws-sdk-cpp/build
RUN cmake -DBUILD_ONLY=dynamodb -DENABLE_TESTING=OFF ..
RUN make -j8
RUN make install
WORKDIR /opt
# Delete the source builds
# RUN yes | rm -r cmake-3.22.1 cmake-3.22.1.tar.gz aws-sdk-cpp
RUN yes | rm -r aws-sdk-cpp
# Install other stuff we need
RUN apt-get -y install certbot python3-certbot-apache
# Copy in the stuff that's useful
ADD deps /srv/redb/deps
ADD librereuse /srv/redb/librereuse
ADD server /srv/redb/server
ADD clustering /srv/redb/clustering
COPY CMakeLists.txt /srv/redb/
COPY db-20000-clusters.json /srv/redb/
# Do da build
WORKDIR /srv/redb/build
RUN cmake -DSKIP_TESTS=TRUE -DSKIP_EXPERIMENTS=TRUE ..
RUN make -j6
# Setup the apache config
COPY server/apache-config.conf /usr/local/apache2/conf/httpd.conf
COPY server/apache-vhosts.conf /usr/local/apache2/conf/extra/httpd-vhosts.conf
COPY server/apache-ssl.conf /usr/local/apache2/conf/extra/httpd-ssl.conf
# Setup ssl for apache
# RUN certbot --apache
# Set environment variable for clusterdb
ENV CLUSTER_DB_PATH=/srv/redb/db-20000-clusters.json
# Set the analysis binary
# COPY regex-static-analysis /usr/local/bin/regex-static-analysis
# ENV REGEX_TOOLS_ANALYSIS_BIN=/usr/local/bin/regex-static-analysis
# expose port 80
EXPOSE 80
EXPOSE 443
# Start the two servers
ENTRYPOINT /srv/redb/build/server/redb-server -p 8080