From 6bf895022c7020c3712f0014a4ba32ea9b574dfa Mon Sep 17 00:00:00 2001 From: root Date: Thu, 28 Jan 2021 09:58:36 +0100 Subject: [PATCH] Makes Dockerfile to multi stage build Eliminates a compile time warning --- Docker/Dockerfile | 20 +++++++++----------- README.md | 6 +++--- chat.h | 2 +- hasses.h | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 9013bcc..a87391b 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -4,24 +4,22 @@ # https://github.com/hyper-prog/hasses # -FROM alpine -LABEL maintainer="hyper80@gmail.com" Description="Hasses asynchronous SSE server" - -RUN apk update \ - && apk add openssl +FROM alpine AS hassesbuildstage +RUN apk update && apk add openssl COPY . /hasses/ RUN apk add libc-dev gcc make openssl-dev \ && cd /hasses \ - && make && make install \ - && cd / && rm -rf /hasses \ - && apk del libc-dev gcc make openssl-dev \ - && mkdir /hassescommon + && make && make install + + +FROM alpine AS hassesdaemon +LABEL maintainer="hyper80@gmail.com" Description="Hasses asynchronous SSE server" +RUN apk update && apk add openssl +COPY --from=hassesbuildstage /usr/local/bin/hasses /usr/local/bin/ EXPOSE 8080 EXPOSE 8085 -VOLUME ["/hassescommon"] - CMD ["-p=8080","-cp=8085","-murl=/sse","-nodaemon"] # Srart hasses daemon when container runs ENTRYPOINT ["/usr/local/bin/hasses"] diff --git a/README.md b/README.md index 38f3832..ad83cde 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ The sse requests matches to the /sse locations by default. #a2enmod proxy_http To the enabled site: - + ProxyPreserveHost On ProxyPass /sseeventprovider http://0.0.0.0:8080/sseeventprovider ProxyPassReverse /sseeventprovider http://0.0.0.0:8080/sseeventprovider @@ -82,7 +82,7 @@ To the enabled site outside the "server" section: keepalive 3200; } -To the enabled site inside the "server" section: +To the enabled site inside the "server" section: location /sseeventprovider { proxy_buffering off; @@ -93,7 +93,7 @@ To the enabled site inside the "server" section: chunked_transfer_encoding on; proxy_pass http://ssebackend; } - + Debugging / Troubleshooting --------------------------- diff --git a/chat.h b/chat.h index 3f652a7..8dfb9d2 100644 --- a/chat.h +++ b/chat.h @@ -5,7 +5,7 @@ #ifndef HASSES_CHAT_H #define HASSES_CHAT_H -struct CliConn *client; +struct CliConn; struct Hasses_Settings; struct Hasses_Statistics; diff --git a/hasses.h b/hasses.h index f55aca1..9334893 100644 --- a/hasses.h +++ b/hasses.h @@ -5,7 +5,7 @@ #ifndef HASSES_HASSES_H #define HASSES_HASSES_H -#define VERSION "1.22" +#define VERSION "1.23" /* The client timeout check interval in seconds */ #define CLIENT_CHK_TIME_INTERVAL 60