-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
32 lines (24 loc) · 899 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
FROM ubuntu:bionic AS build
# Install tools required for the project
RUN apt-get update \
&& apt-get install gcc -y \
&& apt-get install g++ -y \
&& apt-get install cmake -y \
&& apt-get install wget -y
# Install Boost
RUN cd /home \
&& wget http://downloads.sourceforge.net/project/boost/boost/1.68.0/boost_1_68_0.tar.gz \
&& tar xfz boost_1_68_0.tar.gz \
&& rm boost_1_68_0.tar.gz \
&& cd boost_1_68_0 \
&& ./bootstrap.sh --with-libraries=system \
&& ./b2 install
# Copy the entire project and build it
COPY . /cpp/src/project/
WORKDIR /cpp/src/project/
RUN cmake -Bbin -H. && cmake --build bin
FROM ubuntu:bionic
COPY --from=build /cpp/src/project/bin/websocket-chat-server /app/
COPY --from=build /cpp/src/project/chat_client.html /app/wwwroot/index.html
ENTRYPOINT ["/app/websocket-chat-server", "0.0.0.0", "8080", "/app/wwwroot"]
EXPOSE 8080