diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec82596 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu AS builder +WORKDIR /app +COPY httplib.h . +COPY docker/main.cc . +RUN apt update && apt install g++ -y +RUN g++ -std=c++14 -static -o server -O3 -I. -DCPPHTTPLIB_USE_POLL main.cc + +FROM scratch +COPY --from=builder /app/server /server +COPY docker/index.html /html/index.html +CMD ["/server"] diff --git a/docker/index.html b/docker/index.html new file mode 100644 index 0000000..1abe978 --- /dev/null +++ b/docker/index.html @@ -0,0 +1,21 @@ + + +
+If you see this page, the cpp-httplib web server is successfully installed and +working. Further configuration is required.
+ +For online documentation and support please refer to
+github.com/yhirose/cpp-httplib.
+
+
Thank you for using cpp-httplib.
+ + diff --git a/docker/main.cc b/docker/main.cc new file mode 100644 index 0000000..1f65cb6 --- /dev/null +++ b/docker/main.cc @@ -0,0 +1,39 @@ +// +// main.cc +// +// Copyright (c) 2024 Yuji Hirose. All rights reserved. +// MIT License +// + +#include