summaryrefslogtreecommitdiff
path: root/libs/cpp-httplib/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cpp-httplib/Dockerfile')
-rw-r--r--libs/cpp-httplib/Dockerfile13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/cpp-httplib/Dockerfile b/libs/cpp-httplib/Dockerfile
new file mode 100644
index 0000000..3495b42
--- /dev/null
+++ b/libs/cpp-httplib/Dockerfile
@@ -0,0 +1,13 @@
+FROM yhirose4dockerhub/ubuntu-builder AS builder
+WORKDIR /build
+COPY httplib.h .
+COPY docker/main.cc .
+RUN g++ -std=c++23 -static -o server -O2 -I. main.cc && strip server
+
+FROM scratch
+COPY --from=builder /build/server /server
+COPY docker/html/index.html /html/index.html
+EXPOSE 80
+
+ENTRYPOINT ["/server"]
+CMD ["--host", "0.0.0.0", "--port", "80", "--mount", "/:./html"]