From 67ab3b7efb988183d4cb8f9f528c7d9aa48f32a1 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Tue, 13 Sep 2022 07:01:49 +0200
Subject: [PATCH] Updated the certbot

---
 .gitignore         |  1 +
 Dockerfile         | 33 ++-------------------------------
 Makefile           | 11 +++++------
 docker-compose.yml | 23 ++++++-----------------
 4 files changed, 14 insertions(+), 54 deletions(-)

diff --git a/.gitignore b/.gitignore
index 236d556..c174b07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 ## Generated
 site/
+tmp/
 node_modules/
 *.bkp
 swagger/**/docs/*.md
diff --git a/Dockerfile b/Dockerfile
index d9af75c..b65cae1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,32 +1,3 @@
-FROM debian:stable as build
+FROM nginx:latest
 
-ENV PYTHONUNBUFFERED=1
-
-RUN apt-get update && apt-get install -y python3 python3-pip git
-
-COPY requirements.txt ./requirements.txt
-RUN pip3 install -r ./requirements.txt
-
-COPY ./docs/images ./docs/images
-COPY ./docs/operation ./docs/operation
-COPY ./docs/stylesheets ./docs/stylesheets
-COPY ./docs/videos ./docs/videos
-COPY ./docs/contact.md ./docs/contact.md
-COPY ./docs/getting-started.md ./docs/getting-started.md
-COPY ./docs/index.md ./docs/index.md
-COPY ./docs/publications.md ./docs/publications.md
-COPY ./docs/system.md ./docs/system.md
-COPY ./mkdocs.yml ./mkdocs.yml
-
-RUN git clone git@gitlab.phaidra.org:fair-data-austria-db-repository/fda-docs.git
-
-WORKDIR ./fda-docs
-
-# 1.2
-RUN mike deploy 1.2
-
-# 1.1
-RUN git checkout beec500012949c1baa197c72d52e383276a8fd02
-RUN mike deploy 1.1
-
-ENTRYPOINT [ "mkdocs", "build" ]
\ No newline at end of file
+COPY ./site /usr/share/nginx/html
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 468c991..9af9c78 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ all: build
 
 clean:
 	rm -rf ./site
+	docker container stop docs-server || true
+	docker container rm docs-server || true
 
 release-deps:
 	pip3 install -r ./dockerhub/requirements.txt
@@ -15,10 +17,7 @@ release: release-deps
 
 build:
 	docker compose build
-	docker compose up
 
-version:
-	mike list
-
-install: build version
-	sudo cp -r ./site/* /usr/share/nginx/html/
\ No newline at end of file
+install: build
+	sudo certbot certonly --standalone --preferred-challenges http -d dbrepo-docs.ossdip.at --agree-tos --keep-until-expiring
+	docker compose up -d
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 355ad34..d7d3171 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,23 +1,12 @@
 version: "3.6"
 
-networks:
-  fda-public:
-    name: fda-public
-    driver: bridge
-    ipam:
-      config:
-        - subnet: 172.29.0.0/16
-
 services:
 
-  fda-docs-builder:
+  docs-server:
     build: .
-    image: fda-docs-builder
+    container_name: dbrepo-docs-server
+    hostname: dbrepo-docs-server
     volumes:
-      - ./site:/site
-    networks:
-      - fda-public
-    environment:
-      TZ: Europe/Vienna
-    logging:
-      driver: json-file
+      - /etc/letsencrypt/live/:/tmp:ro
+    ports:
+      - 80:80
\ No newline at end of file
-- 
GitLab