1
0
mirror of synced 2025-07-29 11:01:13 +03:00

Update Docker support

This commit is contained in:
yhirose
2024-08-31 17:09:20 -04:00
parent da0c6579fa
commit ba638ff38e
4 changed files with 67 additions and 21 deletions

View File

@ -1,11 +1,12 @@
FROM ubuntu AS builder
WORKDIR /app
WORKDIR /build
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
RUN g++ -std=c++23 -static -o server -O2 -I. -DCPPHTTPLIB_USE_POLL main.cc && strip server
FROM scratch
COPY --from=builder /app/server /server
COPY docker/index.html /html/index.html
COPY --from=builder /build/server /server
COPY docker/html/index.html /html/index.html
EXPOSE 80
CMD ["/server"]