From 1c4bc090fc737662740260a6ad88709b87d1b83c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 21 Apr 2020 12:38:15 +0200 Subject: Improve webpull --- consul/secrets/web/quentin.dufour.io_token.sample | 0 docker/webpull/Dockerfile.nodejs | 9 +++++++++ docker/webpull/Dockerfile.pug | 10 ---------- docker/webpull/Dockerfile.ruby | 12 ++++++++++++ docker/webpull/README.md | 17 +++++++++++++++-- nomad/jitsi.hcl | 2 +- nomad/web_static.hcl | 16 ++++++++++++---- 7 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 consul/secrets/web/quentin.dufour.io_token.sample create mode 100644 docker/webpull/Dockerfile.nodejs delete mode 100644 docker/webpull/Dockerfile.pug create mode 100644 docker/webpull/Dockerfile.ruby diff --git a/consul/secrets/web/quentin.dufour.io_token.sample b/consul/secrets/web/quentin.dufour.io_token.sample new file mode 100644 index 0000000..e69de29 diff --git a/docker/webpull/Dockerfile.nodejs b/docker/webpull/Dockerfile.nodejs new file mode 100644 index 0000000..acc7e74 --- /dev/null +++ b/docker/webpull/Dockerfile.nodejs @@ -0,0 +1,9 @@ +FROM node:13.8-buster + +RUN apt-get update && \ + apt-get install -y git + +COPY ./main /srv/httpd +WORKDIR /srv +CMD ["/srv/httpd"] + diff --git a/docker/webpull/Dockerfile.pug b/docker/webpull/Dockerfile.pug deleted file mode 100644 index 9600f35..0000000 --- a/docker/webpull/Dockerfile.pug +++ /dev/null @@ -1,10 +0,0 @@ -FROM node:13.8-buster - -RUN apt-get update && \ - apt-get install -y git && \ - npm install -g pug-cli jstransformer-markdown-it - -COPY ./main /srv/httpd -WORKDIR /srv -CMD ["/srv/httpd"] - diff --git a/docker/webpull/Dockerfile.ruby b/docker/webpull/Dockerfile.ruby new file mode 100644 index 0000000..7578cca --- /dev/null +++ b/docker/webpull/Dockerfile.ruby @@ -0,0 +1,12 @@ +FROM fedora:32 + +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 +ENV LANGUAGE=en_US.UTF-8 +ENV RUBYOPT --disable-did_you_mean + +RUN dnf install -y git ruby ruby-devel rubygems rubygem-bundler @development-tools redhat-rpm-config gcc-c++ zlib-devel + +COPY ./main /srv/httpd +WORKDIR /srv +CMD ["/srv/httpd"] diff --git a/docker/webpull/README.md b/docker/webpull/README.md index 351d300..5d17d17 100644 --- a/docker/webpull/README.md +++ b/docker/webpull/README.md @@ -2,9 +2,22 @@ Webpull allows you to update your live website without deploying a new docker container but by simply calling an URL -## Pug version +You need to specify a secret token at boot: + +``` +WEBPULL_TOKEN=s3cr3et ./webpull +``` + +## Node.js version + +``` +go build ./main.go +sudo docker build -f ./Dockerfile.nodejs -t superboum/amd64_webpull_pug:v1 . +``` + +## Ruby version ``` go build ./main.go -sudo docker build -f ./Dockerfile.pug -t superboum/amd64_webpull_pug:v1 +sudo docker build -f ./Dockerfile.ruby -t superboum/amd64_webpull_ruby:v1 . ``` diff --git a/nomad/jitsi.hcl b/nomad/jitsi.hcl index 3cf3c7e..bcfab06 100644 --- a/nomad/jitsi.hcl +++ b/nomad/jitsi.hcl @@ -93,7 +93,7 @@ job "jitsi" { task "front" { driver = "docker" config { - image = "superboum/amd64_jitsi_front:v3" + image = "superboum/amd64_jitsi_front:v4" network_mode = "host" port_map { https_port = 443 diff --git a/nomad/web_static.hcl b/nomad/web_static.hcl index b3ad3e8..c935b2a 100644 --- a/nomad/web_static.hcl +++ b/nomad/web_static.hcl @@ -59,19 +59,27 @@ EOH } } - /* To be replaced by a static site manager */ group "quentin" { task "server" { driver = "docker" config { - image = "superboum/amd64_blog:v19" + image = "superboum/amd64_webpull_ruby:v1" port_map { - web_port = 8043 + web_port = 8080 } } + template { + data = <