File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1- FROM ubuntu AS builder
1+ FROM yhirose4dockerhub/ ubuntu-builder AS builder
22WORKDIR /build
33COPY httplib.h .
44COPY docker/main.cc .
5- RUN apt update && apt install g++ -y
65RUN g++ -std=c++23 -static -o server -O2 -I. -DCPPHTTPLIB_USE_POLL main.cc && strip server
76
87FROM scratch
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ constexpr auto error_html = R"(<html>
2323</html>
2424)" ;
2525
26+ void sigint_handler (int s) { exit (1 ); }
27+
2628std::string time_local () {
2729 auto p = std::chrono::system_clock::now ();
2830 auto t = std::chrono::system_clock::to_time_t (p);
@@ -49,6 +51,8 @@ std::string log(auto &req, auto &res) {
4951}
5052
5153int main (int argc, const char **argv) {
54+ signal (SIGINT, sigint_handler);
55+
5256 auto base_dir = " ./html" ;
5357 auto host = " 0.0.0.0" ;
5458 auto port = 80 ;
You can’t perform that action at this time.
0 commit comments