diff --git a/.gitmodules b/.gitmodules index aec303d..7da38dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "docker/static/goStatic"] - path = docker/static/goStatic + path = app/build/static/goStatic url = https://github.com/PierreZ/goStatic [submodule "docker/blog/quentin.dufour.io"] path = docker/blog-quentin/quentin.dufour.io diff --git a/README.md b/README.md index 1c0375b..7c7a3a6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ We try to build a generic abstraction stack between our different resources (CPU * ansible (physical node conf) * nomad (schedule containers) * consul (distributed key value store / lock / service discovery) - * glusterfs (file storage) + * garage/glusterfs (file storage) * stolon + postgresql (distributed relational database) * docker (container tool) * bottin (LDAP server, auth) @@ -23,6 +23,21 @@ Some services we provide: As a generic abstraction is provided, deploying new services should be easy. +## I am lost, how this repo works? + +To ease the development, we make the choice of a fully integrated environment + + 1. `os` the base os for the cluster + 1. `build`: where you will build our OS image based on Debian that you will install on your server + 2. `config`: our Ansible recipes to configure and update your freshly installed server + 2. `apps` apps we deploy on the cluster + 1. `build`: our Docker files to build immutable images of our applications + 2. `integration`: Our Docker compose files to test locally how our built images interact together + 3. `config`: Files containing application configurations to be deployed on Consul Key Value Store + 4. `deployment`: Files containing application definitions to be deployed on Nomad Scheduler + 3. `op_guide`: Guides to explain you operations you can do cluster wide (like configuring postgres) + + ## Start hacking ### Clone the repository diff --git a/docker/README.md b/app/build/README.md similarity index 100% rename from docker/README.md rename to app/build/README.md diff --git a/docker/blog-quentin/.dockerenv b/app/build/blog-quentin/.dockerenv similarity index 100% rename from docker/blog-quentin/.dockerenv rename to app/build/blog-quentin/.dockerenv diff --git a/docker/blog-quentin/Dockerfile b/app/build/blog-quentin/Dockerfile similarity index 100% rename from docker/blog-quentin/Dockerfile rename to app/build/blog-quentin/Dockerfile diff --git a/docker/blog-quentin/README.md b/app/build/blog-quentin/README.md similarity index 100% rename from docker/blog-quentin/README.md rename to app/build/blog-quentin/README.md diff --git a/docker/coturn/Dockerfile b/app/build/coturn/Dockerfile similarity index 100% rename from docker/coturn/Dockerfile rename to app/build/coturn/Dockerfile diff --git a/docker/coturn/README.md b/app/build/coturn/README.md similarity index 100% rename from docker/coturn/README.md rename to app/build/coturn/README.md diff --git a/app/build/docker-compose.yml b/app/build/docker-compose.yml new file mode 100644 index 0000000..94bc154 --- /dev/null +++ b/app/build/docker-compose.yml @@ -0,0 +1,63 @@ +version: '3.4' +services: + + # Instant Messaging + riot: + build: + context: ./riotweb + args: + # https://github.com/vector-im/riot-web/releases + VERSION: 1.7.5 + image: superboum/amd64_riotweb:v15 + + synapse: + build: + context: ./matrix-synapse + args: + # https://github.com/matrix-org/synapse/releases + VERSION: 1.19.1 + image: superboum/amd64_synapse:v33 + + # Email + sogo: + build: + context: ./sogo + args: + # fake for now + VERSION: 5.0.0 + image: superboum/amd64_sogo:v7 + + # VoIP + jitsi-meet: + build: + context: ./jitsi-meet + args: + # https://github.com/jitsi/jitsi-meet + PREFIXV: stable/jitsi-meet_ + VERSION: 4966 + image: superboum/amd64_jitsi_meet:v1 + + jitsi-conference-focus: + build: + context: ./jitsi-conference-focus + args: + # https://github.com/jitsi/jicofo + PREFIXV: stable/jitsi-meet_ + VERSION: 4966 + image: superboum/amd64_jitsi_conference_focus:v5 + + jitsi-videobridge: + build: + context: ./jitsi-videobridge + args: + # https://github.com/jitsi/jitsi-videobridge + PREFIXV: stable/jitsi-meet_ + VERSION: 4966 + image: superboum/amd64_jitsi_videobridge:v15 + + jitsi-xmpp: + build: + context: ./jitsi-xmpp + args: + VERSION: fake-1 + image: superboum/amd64_jitsi_xmpp:v4 diff --git a/docker/dovecot/.gitignore b/app/build/dovecot/.gitignore similarity index 100% rename from docker/dovecot/.gitignore rename to app/build/dovecot/.gitignore diff --git a/docker/dovecot/Dockerfile b/app/build/dovecot/Dockerfile similarity index 100% rename from docker/dovecot/Dockerfile rename to app/build/dovecot/Dockerfile diff --git a/docker/dovecot/README.md b/app/build/dovecot/README.md similarity index 100% rename from docker/dovecot/README.md rename to app/build/dovecot/README.md diff --git a/docker/dovecot/entrypoint.sh b/app/build/dovecot/entrypoint.sh similarity index 100% rename from docker/dovecot/entrypoint.sh rename to app/build/dovecot/entrypoint.sh diff --git a/app/build/jitsi-conference-focus/Dockerfile b/app/build/jitsi-conference-focus/Dockerfile new file mode 100644 index 0000000..e2c459c --- /dev/null +++ b/app/build/jitsi-conference-focus/Dockerfile @@ -0,0 +1,27 @@ +FROM debian:buster AS builder + +ARG PREFIXV +ARG VERSION +RUN apt-get update && \ + apt-get install -y openjdk-11-jdk maven wget unzip && \ + wget https://github.com/jitsi/jicofo/archive/${PREFIXV}${VERSION}.zip -O jicofo.zip + +RUN unzip jicofo.zip && \ + mv jicofo*${VERSION} jicofo && \ + cd jicofo && \ + mvn package -DskipTests -Dassembly.skipAssembly=false && \ + unzip target/jicofo-1.1-SNAPSHOT-archive.zip && \ + mv jicofo-1.1-SNAPSHOT /srv/build + +FROM debian:buster + +RUN apt-get update && \ + apt-get install -y openjdk-11-jre-headless ca-certificates + +ENV JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/root -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=.sip-communicator -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi" + +COPY --from=builder /srv/build /srv/jicofo +COPY jicofo /usr/local/bin/jicofo +COPY sip-communicator.properties /root/.sip-communicator/sip-communicator.properties + +CMD ["/usr/local/bin/jicofo"] diff --git a/docker/jitsi/jitsi-conference-focus/jicofo b/app/build/jitsi-conference-focus/jicofo similarity index 100% rename from docker/jitsi/jitsi-conference-focus/jicofo rename to app/build/jitsi-conference-focus/jicofo diff --git a/app/build/jitsi-conference-focus/sip-communicator.properties b/app/build/jitsi-conference-focus/sip-communicator.properties new file mode 100644 index 0000000..53c32e2 --- /dev/null +++ b/app/build/jitsi-conference-focus/sip-communicator.properties @@ -0,0 +1,2 @@ +org.jitsi.jicofo.SHORT_ID=1 +org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.jitsi.deuxfleurs.fr diff --git a/app/build/jitsi-meet/Dockerfile b/app/build/jitsi-meet/Dockerfile new file mode 100644 index 0000000..feef115 --- /dev/null +++ b/app/build/jitsi-meet/Dockerfile @@ -0,0 +1,28 @@ +FROM debian:buster AS builder + +ARG PREFIXV +ARG VERSION + +RUN apt-get update && \ + apt-get install -y curl && \ + curl -sL https://deb.nodesource.com/setup_14.x | bash - && \ + apt-get install -y git nodejs make wget unzip && \ + wget https://github.com/jitsi/jitsi-meet/archive/${PREFIXV}${VERSION}.zip -O jitsi-meet.zip + +RUN unzip jitsi-meet.zip && \ + mv jitsi-meet-*${VERSION} jitsi-meet && \ + cd jitsi-meet && \ + npm install && \ + make + +FROM debian:buster + +COPY --from=builder /jitsi-meet /srv/jitsi-meet +RUN apt-get update && \ + apt-get install -y nginx && \ + rm /etc/nginx/sites-enabled/* + +COPY config.js /srv/jitsi-meet/config.js +COPY entrypoint.sh /usr/local/bin/entrypoint +ENTRYPOINT ["/usr/local/bin/entrypoint"] +CMD ["/usr/sbin/nginx", "-g", "daemon off;"] diff --git a/docker/jitsi/jitsi-front/config.js b/app/build/jitsi-meet/config.js similarity index 100% rename from docker/jitsi/jitsi-front/config.js rename to app/build/jitsi-meet/config.js diff --git a/docker/jitsi/jitsi-front/entrypoint.sh b/app/build/jitsi-meet/entrypoint.sh similarity index 100% rename from docker/jitsi/jitsi-front/entrypoint.sh rename to app/build/jitsi-meet/entrypoint.sh diff --git a/docker/jitsi/jitsi-videobridge/Dockerfile b/app/build/jitsi-videobridge/Dockerfile similarity index 59% rename from docker/jitsi/jitsi-videobridge/Dockerfile rename to app/build/jitsi-videobridge/Dockerfile index 16f59dc..c17fb4f 100644 --- a/docker/jitsi/jitsi-videobridge/Dockerfile +++ b/app/build/jitsi-videobridge/Dockerfile @@ -1,21 +1,24 @@ FROM debian:buster AS builder -RUN apt-get update && \ - apt-get install -y wget unzip maven openjdk-11-jdk +ARG PREFIXV +ARG VERSION -ENV VERSION=4468 -RUN wget https://github.com/jitsi/jitsi-videobridge/archive/stable/jitsi-meet_${VERSION}.zip -O jvb.zip && \ - unzip jvb.zip && \ - mv jitsi-videobridge-stable-jitsi-meet_${VERSION} jvb && \ +RUN apt-get update && \ + apt-get install -y wget unzip maven openjdk-11-jdk && \ + wget https://github.com/jitsi/jitsi-videobridge/archive/${PREFIXV}${VERSION}.zip -O jvb.zip + +RUN unzip jvb.zip && \ + mv jitsi-videobridge*${VERSION} jvb && \ cd jvb && \ mvn package -DskipTests && \ - unzip target/jitsi-videobridge-*.zip && \ + ls jvb/target && \ + unzip jvb/target/jitsi-videobridge*.zip && \ mv jitsi-videobridge-*-SNAPSHOT build FROM debian:buster RUN apt-get update && \ - apt-get install -y openjdk-11-jdk + apt-get install -y openjdk-11-jre-headless COPY --from=builder /jvb/build /srv/jvb ENV HOME=/root diff --git a/docker/jitsi/jitsi-videobridge/jvb_run b/app/build/jitsi-videobridge/jvb_run similarity index 64% rename from docker/jitsi/jitsi-videobridge/jvb_run rename to app/build/jitsi-videobridge/jvb_run index 3352e8a..b86c911 100755 --- a/docker/jitsi/jitsi-videobridge/jvb_run +++ b/app/build/jitsi-videobridge/jvb_run @@ -8,9 +8,24 @@ EOF mkdir -p /root/.sip-communicator cat > /root/.sip-communicator/sip-communicator.properties < /etc/prosody/conf.avail/jitsi.deuxfleurs.fr.cfg.lua <