File tree 2 files changed +5
-2
lines changed
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
2
2
WORKDIR /build
3
3
COPY httplib.h .
4
4
COPY docker/main.cc .
5
- RUN apt update && apt install g++ -y
6
5
RUN g++ -std=c++23 -static -o server -O2 -I. -DCPPHTTPLIB_USE_POLL main.cc && strip server
7
6
8
7
FROM scratch
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ constexpr auto error_html = R"(<html>
23
23
</html>
24
24
)" ;
25
25
26
+ void sigint_handler (int s) { exit (1 ); }
27
+
26
28
std::string time_local () {
27
29
auto p = std::chrono::system_clock::now ();
28
30
auto t = std::chrono::system_clock::to_time_t (p);
@@ -49,6 +51,8 @@ std::string log(auto &req, auto &res) {
49
51
}
50
52
51
53
int main (int argc, const char **argv) {
54
+ signal (SIGINT, sigint_handler);
55
+
52
56
auto base_dir = " ./html" ;
53
57
auto host = " 0.0.0.0" ;
54
58
auto port = 80 ;
You can’t perform that action at this time.
0 commit comments