aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--consul/secrets/web/quentin.dufour.io_token.sample0
-rw-r--r--docker/webpull/Dockerfile.nodejs (renamed from docker/webpull/Dockerfile.pug)3
-rw-r--r--docker/webpull/Dockerfile.ruby12
-rw-r--r--docker/webpull/README.md17
-rw-r--r--nomad/jitsi.hcl2
-rw-r--r--nomad/web_static.hcl16
6 files changed, 41 insertions, 9 deletions
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
--- /dev/null
+++ b/consul/secrets/web/quentin.dufour.io_token.sample
diff --git a/docker/webpull/Dockerfile.pug b/docker/webpull/Dockerfile.nodejs
index 9600f35..acc7e74 100644
--- a/docker/webpull/Dockerfile.pug
+++ b/docker/webpull/Dockerfile.nodejs
@@ -1,8 +1,7 @@
FROM node:13.8-buster
RUN apt-get update && \
- apt-get install -y git && \
- npm install -g pug-cli jstransformer-markdown-it
+ apt-get install -y git
COPY ./main /srv/httpd
WORKDIR /srv
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 = <<EOH
+WEBPULL_REPO="https://git.deuxfleurs.fr/quentin/quentin.dufour.io.git"
+WEBPULL_TOKEN="{{ key "secrets/web/quentin.dufour.io_token" | trimSpace }}"
+EOH
+ destination = "secrets/env"
+ env = true
+ }
+
resources {
- memory = 20
+ memory = 500
network {
port "web_port" {}
}