forked from Deuxfleurs/infrastructure
Improve webpull
This commit is contained in:
parent
4c2ae7f696
commit
1c4bc090fc
6 changed files with 41 additions and 9 deletions
0
consul/secrets/web/quentin.dufour.io_token.sample
Normal file
0
consul/secrets/web/quentin.dufour.io_token.sample
Normal file
|
@ -1,8 +1,7 @@
|
||||||
FROM node:13.8-buster
|
FROM node:13.8-buster
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y git && \
|
apt-get install -y git
|
||||||
npm install -g pug-cli jstransformer-markdown-it
|
|
||||||
|
|
||||||
COPY ./main /srv/httpd
|
COPY ./main /srv/httpd
|
||||||
WORKDIR /srv
|
WORKDIR /srv
|
12
docker/webpull/Dockerfile.ruby
Normal file
12
docker/webpull/Dockerfile.ruby
Normal file
|
@ -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"]
|
|
@ -2,9 +2,22 @@
|
||||||
|
|
||||||
Webpull allows you to update your live website without deploying a new docker container but by simply calling an URL
|
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
|
go build ./main.go
|
||||||
sudo docker build -f ./Dockerfile.pug -t superboum/amd64_webpull_pug:v1
|
sudo docker build -f ./Dockerfile.nodejs -t superboum/amd64_webpull_pug:v1 .
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ruby version
|
||||||
|
|
||||||
|
```
|
||||||
|
go build ./main.go
|
||||||
|
sudo docker build -f ./Dockerfile.ruby -t superboum/amd64_webpull_ruby:v1 .
|
||||||
```
|
```
|
||||||
|
|
|
@ -93,7 +93,7 @@ job "jitsi" {
|
||||||
task "front" {
|
task "front" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
config {
|
config {
|
||||||
image = "superboum/amd64_jitsi_front:v3"
|
image = "superboum/amd64_jitsi_front:v4"
|
||||||
network_mode = "host"
|
network_mode = "host"
|
||||||
port_map {
|
port_map {
|
||||||
https_port = 443
|
https_port = 443
|
||||||
|
|
|
@ -59,19 +59,27 @@ EOH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* To be replaced by a static site manager */
|
|
||||||
group "quentin" {
|
group "quentin" {
|
||||||
task "server" {
|
task "server" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
config {
|
config {
|
||||||
image = "superboum/amd64_blog:v19"
|
image = "superboum/amd64_webpull_ruby:v1"
|
||||||
port_map {
|
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 {
|
resources {
|
||||||
memory = 20
|
memory = 500
|
||||||
network {
|
network {
|
||||||
port "web_port" {}
|
port "web_port" {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue