Browse Source

fix: make OCaml frameworks use keep alive (#6133)

* tini has problems with subreaping so make bash script the entrypoint
https://github.com/krallin/tini#subreaping
Robin Björklin 4 years ago
parent
commit
e905992a65

+ 2 - 2
frameworks/OCaml/opium/haproxy.cfg

@@ -7,10 +7,10 @@ global
     nbthread    2
 
 defaults
-    mode                    tcp
+    mode                    http
     log                     global
     option                  dontlognull
-    option http-server-close
+    option http-keep-alive
     option forwardfor       except 127.0.0.0/8
     option                  redispatch
     retries                 3

+ 1 - 1
frameworks/OCaml/opium/opium-haproxy.dockerfile

@@ -24,4 +24,4 @@ COPY haproxy.cfg /etc/haproxy/haproxy.cfg
 COPY start-servers.sh ./start-servers.sh
 RUN sudo chown -R opam: /${DIR} && chmod +x ./start-servers.sh
 
-CMD ./start-servers.sh && sudo /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -q
+ENTRYPOINT ./start-servers.sh && sudo /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid

+ 1 - 1
frameworks/OCaml/opium/opium.dockerfile

@@ -18,4 +18,4 @@ COPY ./src ./
 
 RUN sudo chown -R opam: . && make build
 
-CMD _build/default/bin/main.exe
+ENTRYPOINT _build/default/bin/main.exe

+ 2 - 2
frameworks/OCaml/webmachine/haproxy.cfg

@@ -7,10 +7,10 @@ global
     nbthread    2
 
 defaults
-    mode                    tcp
+    mode                    http
     log                     global
     option                  dontlognull
-    option http-server-close
+    option http-keep-alive
     option forwardfor       except 127.0.0.0/8
     option                  redispatch
     retries                 3

+ 1 - 1
frameworks/OCaml/webmachine/webmachine-haproxy.dockerfile

@@ -25,4 +25,4 @@ COPY haproxy.cfg /etc/haproxy/haproxy.cfg
 COPY start-servers.sh ./start-servers.sh
 RUN sudo chown -R opam: . && chmod +x ./start-servers.sh
 
-CMD ./start-servers.sh && sudo /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -q
+ENTRYPOINT ./start-servers.sh && sudo /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid

+ 1 - 1
frameworks/OCaml/webmachine/webmachine.dockerfile

@@ -19,4 +19,4 @@ COPY ./src /${DIR}
 
 RUN sudo chown -R opam: . && make build
 
-CMD _build/default/tfb.exe
+ENTRYPOINT _build/default/tfb.exe