Dockerized the website

This commit is contained in:
Roger Gonzalez 2024-02-08 19:13:27 -03:00
parent 0bf6b72d5f
commit 209ee46444
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
10 changed files with 49 additions and 185 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
./public
./.packages
./.git

1
.gitignore vendored
View File

@ -1 +1,2 @@
.packages/ .packages/
public/

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM nginx:alpine
LABEL maintainer="Roger Gonzalez <roger@rogs.me>"
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;"]

View File

@ -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 Go to ./content/menu.org and run the code block. On the "RESULTS" section, remove the ~:~ at the begining
of the result. 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 * License
:PROPERTIES: :PROPERTIES:
:ID: 847b2c69-f711-4bde-b75c-c95a8d9cba9e :ID: 847b2c69-f711-4bde-b75c-c95a8d9cba9e

View File

@ -1,5 +1,5 @@
#+title: Org Mode Wiki site #+title: Org Mode Wiki site
#+INCLUDE: "~/code/personal/org-web-wiki-template/content/menu.org" #+INCLUDE: "./menu.org"
* Overview * Overview
:PROPERTIES: :PROPERTIES:

View File

@ -1,5 +1,5 @@
#+title: Another section #+title: Another section
#+INCLUDE: "~/code/personal/org-web-wiki-template/content/menu.org" #+INCLUDE: "../menu.org"
This is another section This is another section

8
deploy.sh Executable file
View File

@ -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"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long