From 209ee46444ac9620daacb74887baa7e0bc939982 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Thu, 8 Feb 2024 19:13:27 -0300 Subject: [PATCH] Dockerized the website --- .dockerignore | 3 ++ .gitignore | 1 + Dockerfile | 16 ++++++++ README.org | 19 ++++++++++ content/index.org | 2 +- content/section/index.org | 2 +- deploy.sh | 8 ++++ public/index.html | 79 --------------------------------------- public/menu.html | 41 -------------------- public/section/index.html | 63 ------------------------------- 10 files changed, 49 insertions(+), 185 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 deploy.sh delete mode 100644 public/index.html delete mode 100644 public/menu.html delete mode 100644 public/section/index.html diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..550b510 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +./public +./.packages +./.git diff --git a/.gitignore b/.gitignore index 162e249..f6925bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .packages/ +public/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1a04dc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM nginx:alpine +LABEL maintainer="Roger Gonzalez " + +WORKDIR /app +COPY . . + +RUN rm /usr/share/nginx/html/* && \ + apk add --no-cache emacs git && \ + emacs -Q --script build-site.el && \ + cp -R ./public/* /usr/share/nginx/html && \ + apk del emacs git + +EXPOSE 80 + +# Start Nginx and keep it running in the foreground +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.org b/README.org index 93f7e10..7b657de 100644 --- a/README.org +++ b/README.org @@ -28,6 +28,25 @@ Now, run ~./build.sh~: Go to ./content/menu.org and run the code block. On the "RESULTS" section, remove the ~:~ at the begining of the result. +* Deploy +:PROPERTIES: +:ID: 2986441f-1d14-4dcd-9282-9c7aa194a6e8 +:END: +This package is self deployable, ready to run behind a proxy (like NGINX Proxy Manager) + +Make sure you have Emacs installed on the destination server. + +First, make ~deploy.sh~ an executable: +#+begin_src bash +chmod +x deploy.sh +#+end_src + +Now run ~./deploy.sh~: +#+begin_src bash +NAME="org-wiki" PORT=8080 ./deploy.sh +#+end_src + + * License :PROPERTIES: :ID: 847b2c69-f711-4bde-b75c-c95a8d9cba9e diff --git a/content/index.org b/content/index.org index 873bef7..5590252 100644 --- a/content/index.org +++ b/content/index.org @@ -1,5 +1,5 @@ #+title: Org Mode Wiki site -#+INCLUDE: "~/code/personal/org-web-wiki-template/content/menu.org" +#+INCLUDE: "./menu.org" * Overview :PROPERTIES: diff --git a/content/section/index.org b/content/section/index.org index 47ed382..9ec8403 100644 --- a/content/section/index.org +++ b/content/section/index.org @@ -1,5 +1,5 @@ #+title: Another section -#+INCLUDE: "~/code/personal/org-web-wiki-template/content/menu.org" +#+INCLUDE: "../menu.org" This is another section diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..8d415bc --- /dev/null +++ b/deploy.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +docker rm "$NAME" --force + +docker image rm "$NAME" + +docker build -t "$NAME" . + +docker run --name "$NAME" -d -p "$PORT":80 "$NAME" diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 48d9a44..0000000 --- a/public/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - -Org Mode Wiki site - - - - - - - - -
-

Org Mode Wiki site

-
-

Table of Contents

- -
- - - --- -- - - - - - - -
IndexSection
- -
-

Overview

-
-

-This is an example of a wiki written with Org Mode! -

-
-
- -
-

Another setion

-
-

-This is a new section, very different to the first one -

-
-
- -
-

Pretty cool!

-
-

-wow -

-
-
-
-
-

Author: Roger Gonzalez

-

Emacs 29.2 (Org mode 9.6.15)

-
- - diff --git a/public/menu.html b/public/menu.html deleted file mode 100644 index 3f65303..0000000 --- a/public/menu.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - -
- - - --- -- - - - - - - -
IndexSection
-
-
-

Author: Roger Gonzalez

-

Emacs 29.2 (Org mode 9.6.15)

-
- - diff --git a/public/section/index.html b/public/section/index.html deleted file mode 100644 index 7277ce0..0000000 --- a/public/section/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - -Another section - - - - - - - - -
-

Another section

-
-

Table of Contents

- -
- - - --- -- - - - - - - -
IndexSection
- -

-This is another section -

- -
-

Pretty cool huh?

-
-

-yea -

-
-
-
-
-

Author: Roger Gonzalez

-

Emacs 29.2 (Org mode 9.6.15)

-
- -