commit 0edc8f3d1e071ec1f9a0335c9b9687b39ead552e Author: meliurwen Date: Thu Aug 20 11:58:53 2020 +0200 Moving on git diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e3a0e90 --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +VOLUMES_FOLDER=/srv/docker/volumes + +TZ=Europe/Berlin + +VIRTUAL_HOST=example.tld +LETSENCRYPT_HOST=example.tld +LETSENCRYPT_EMAIL=username@example.tld + +NETWORK=webservices diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..579e82c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +version: "3" +services: + znc: + build: + context: znc/ + container_name: znc + restart: unless-stopped + volumes: + - ${VOLUMES_FOLDER}/irc/znc/config:/config + - ${VOLUMES_FOLDER}/irc/znc/etc/proxychains/proxychains.conf:/etc/proxychains/proxychains.conf + ports: + - "6501:6501" + environment: + - PUID=1000 + - PGID=1000 + - TZ=${TZ} + + nginx-reverseproxy-irc: + image: nginx:stable-alpine + container_name: nginx-reverseproxy-irc + restart: unless-stopped + volumes: + - ${VOLUMES_FOLDER}/irc/nginx/data/conf.d:/etc/nginx/conf.d + expose: + - 80 + environment: + - TZ=${TZ} + - VIRTUAL_HOST=${VIRTUAL_HOST} + - VIRTUAL_PORT=80 + - LETSENCRYPT_HOST=${LETSENCRYPT_HOST} + - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} + + webircgateway: + build: + context: webircgateway/ + container_name: webircgateway + restart: unless-stopped + volumes: + - ${VOLUMES_FOLDER}/irc/webircgateway/config.conf:/app/config.conf:ro + expose: + - 80 + environment: + - PUID=1000 + - PGID=1000 + - TZ=${TZ} + + kiwiirc: + build: + context: kiwiirc/ + container_name: kiwiirc + restart: unless-stopped + volumes: + - ${VOLUMES_FOLDER}/irc/kiwiirc/config.json:/usr/share/nginx/html/static/config.json:ro + - ${VOLUMES_FOLDER}/irc/kiwiirc/background.svg:/usr/share/nginx/html/static/img/background.svg:ro + - ${VOLUMES_FOLDER}/irc/kiwiirc/favicon.png:/usr/share/nginx/html/static/favicon.png:ro + - ${VOLUMES_FOLDER}/irc/kiwiirc/erac-logo.svg:/usr/share/nginx/html/static/img/erac-logo.svg:ro + expose: + - 80 + environment: + - TZ=${TZ} + + znc-log-viewer-php: + container_name: znc-log-viewer-php + image: httpd:alpine + restart: unless-stopped + volumes: + - ${VOLUMES_FOLDER}/irc/znc/config/moddata/log:/usr/local/apache2/htdocs/logs:ro + expose: + - "80" + environment: + - TZ=${TZ} + + +networks: + default: + external: + name: ${NETWORK} diff --git a/kiwiirc/Dockerfile b/kiwiirc/Dockerfile new file mode 100644 index 0000000..e196b77 --- /dev/null +++ b/kiwiirc/Dockerfile @@ -0,0 +1,15 @@ +FROM node:current-alpine AS builder + +RUN apk --update add git && \ + git clone https://github.com/kiwiirc/kiwiirc.git && \ + cd kiwiirc && \ + yarn install && \ + yarn run build + + +FROM nginx:stable AS kiwiirc + +COPY --from=builder /kiwiirc/dist /usr/share/nginx/html +#COPY static/config.json /usr/share/nginx/html/static/config.json + +EXPOSE 80 diff --git a/webircgateway/Dockerfile b/webircgateway/Dockerfile new file mode 100644 index 0000000..49aef4d --- /dev/null +++ b/webircgateway/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:alpine AS builder + +RUN apk --update add git g++ && \ + git clone --depth=1 --single-branch https://github.com/kiwiirc/webircgateway.git && \ + cd webircgateway && \ + go build + +FROM golang:alpine AS webircgateway + +COPY --from=builder /go/webircgateway/webircgateway /app/webircgateway + +WORKDIR /app + +CMD ["./webircgateway", "--config=config.conf"] diff --git a/znc/Dockerfile b/znc/Dockerfile new file mode 100644 index 0000000..779046c --- /dev/null +++ b/znc/Dockerfile @@ -0,0 +1,18 @@ +FROM linuxserver/znc:latest + +# From ZNC 1.8 Q is retired: https://wiki.znc.in/Q +# Modules: https://wiki.znc.in/Modules +# How compile modules: https://wiki.znc.in/Compiling_modules +# The lastest linuxserver image with Q integrated si `amd64-znc-1.7.5-ls35` +# So we need to compile it for ourserlves + +RUN wget https://raw.githubusercontent.com/znc/znc/8d309bbb3dc6bef558a2ffe4f523a0467dda8057/modules/q.cpp && \ + apk add --no-cache g++ openssl-dev icu-dev tcl-dev && \ + znc-buildmod q.cpp && \ + rm q.cpp && \ + mv q.so /usr/lib/znc/q.so + +RUN apk add --no-cache \ + proxychains-ng + +COPY root/ / diff --git a/znc/root/etc/services.d/znc/run b/znc/root/etc/services.d/znc/run new file mode 100644 index 0000000..e2eb546 --- /dev/null +++ b/znc/root/etc/services.d/znc/run @@ -0,0 +1,7 @@ +#!/usr/bin/with-contenv sh + +umask 022 + +exec \ + s6-setuidgid abc proxychains /usr/bin/znc -d /config \ +--foreground