Update to use lighttpd

main
Jerry Aldrich 3 years ago
parent c2f1101d7e
commit fd87a0adae
  1. 26
      client/Dockerfile
  2. 13
      client/entrypoint.sh
  3. 23
      client/lighttpd.conf
  4. 14
      content/Dockerfile
  5. 3
      content/cors.conf
  6. 28
      content/lighttpd.conf
  7. 7
      docker-compose.yaml

@ -4,26 +4,18 @@ RUN apk add --no-cache git
WORKDIR /src
RUN git clone --depth=1 --recurse-submodules https://github.com/glennhartmann/quakejs
RUN git clone --depth=1 https://github.com/glennhartmann/quakejs
FROM alpine:latest
FROM jerryaldrichiii/lighttpd:1.4.64-r0
RUN apk add --no-cache lighttpd
RUN chown -R lighttpd /var/log/lighttpd
COPY lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY --from=build /src/quakejs/html/ /srv/http/
RUN chown -R lighttpd /srv
COPY index.html.template /bootstrap/index.html.template
RUN chown -R lighttpd /bootstrap
EXPOSE 8080
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY --from=build /src/quakejs/html/ /srv/html/
USER lighttpd
RUN rm /srv/html/index.html
EXPOSE 8080
ENTRYPOINT ["/entrypoint.sh"]
CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]
RUN mkdir -p /tmp/bootstrap
COPY index.html.template /tmp/bootstrap/index.html.template
COPY entrypoint.sh /docker-entrypoint.d/10-quakejs-client.sh

@ -3,15 +3,14 @@
# Exit on error
set -e
sed -i "s/QUAKEJS_TAB_TITLE/${QUAKEJS_TAB_TITLE:=Quake JS}/" /bootstrap/index.html.template
sed -i "s/QUAKEJS_CONTENT_URL/${QUAKEJS_CONTENT_URL:=content.quakejs.com}/" /bootstrap/index.html.template
sed -i "s/QUAKEJS_SERVER_URL/$QUAKEJS_SERVER_URL/" /bootstrap/index.html.template
sed -i "s/QUAKEJS_TAB_TITLE/${QUAKEJS_TAB_TITLE:=Quake JS}/" /tmp/bootstrap/index.html.template
sed -i "s/QUAKEJS_CONTENT_URL/${QUAKEJS_CONTENT_URL:=content.quakejs.com}/" /tmp/bootstrap/index.html.template
sed -i "s/QUAKEJS_SERVER_URL/$QUAKEJS_SERVER_URL/" /tmp/bootstrap/index.html.template
if [ -n "$QUAKEJS_USE_SSL" ]; then
sed -i "s/'http:\/\/'/\'https:\/\/'/g" /srv/http/ioquake3.js
sed -i "s/'ws:\/\/'/\'wss:\/\/'/g" /srv/http/ioquake3.js
sed -i "s/'http:\/\/'/\'https:\/\/'/g" /srv/html/ioquake3.js
sed -i "s/'ws:\/\/'/\'wss:\/\/'/g" /srv/html/ioquake3.js
fi
cp /bootstrap/index.html.template /srv/http/index.html
cp -f /tmp/bootstrap/index.html.template /srv/html/index.html
lighttpd -D -f /etc/lighttpd/lighttpd.conf

@ -1,23 +0,0 @@
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_access",
"mod_accesslog",
)
include "mime-types.conf"
server.document-root = "/srv/http/"
server.pid-file = "/tmp/lighttpd.pid"
server.errorlog-use-syslog = "enable"
accesslog.use-syslog = "enable"
server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm")
server.port = 8080
url.access-deny = ("~", ".inc")
server.network-backend = "writev"

@ -8,17 +8,11 @@ RUN wget https://steamforge.net/files/quakejs/get_assets.sh
RUN bash get_assets.sh
FROM alpine:latest
FROM jerryaldrichiii/lighttpd:1.4.64-r0
RUN apk add --no-cache lighttpd
RUN chown -R lighttpd /var/log/lighttpd
USER lighttpd
EXPOSE 8080
COPY lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY --from=build /src/assets /srv/http/assets
COPY cors.conf /etc/lighttpd/conf.d/cors.conf
EXPOSE 8080
COPY --from=build /src/assets /srv/html/assets
CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]

@ -0,0 +1,3 @@
setenv.add-response-header = (
"Access-Control-Allow-Origin" => "*",
)

@ -1,28 +0,0 @@
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_access",
"mod_accesslog",
"mod_setenv",
)
setenv.add-response-header = (
"Access-Control-Allow-Origin" => "*",
)
include "mime-types.conf"
server.document-root = "/srv/http/"
server.pid-file = "/tmp/lighttpd.pid"
server.errorlog-use-syslog = "enable"
accesslog.use-syslog = "enable"
server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm")
server.port = 8080
url.access-deny = ("~", ".inc")
server.network-backend = "writev"

@ -13,8 +13,7 @@ services:
depends_on:
- content
- server
#build: client/
image: nginxinc/nginx-unprivileged
build: client/
ports:
- "8080:8080"
environment:
@ -22,11 +21,9 @@ services:
- "QUAKEJS_CONTENT_URL=172.16.69.1:9999"
# Prevent subnet conflict with OpenVPN
# Can connect to services via 172.69.0.1:PORT
# NOTE: localhost:8080 will no longer work
networks:
default:
ipam:
driver: default
config:
- subnet: 172.16.69.0/16
- subnet: 172.16.69.0/24

Loading…
Cancel
Save