From e8cff9b1d4d5224db816ee4b5aada74da9abd070 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 21 Nov 2024 16:14:12 +0100 Subject: [PATCH] redesigned --- .gitignore | 1 - Dockerfile => dist/Dockerfile | 0 nginx.cnf => dist/nginx.cnf | 0 openssl.cnf => dist/openssl.cnf | 0 zonefile.cnf => dist/zonefile.cnf | 0 install.sh | 12 ++++++++++++ 6 files changed, 12 insertions(+), 1 deletion(-) rename Dockerfile => dist/Dockerfile (100%) rename nginx.cnf => dist/nginx.cnf (100%) rename openssl.cnf => dist/openssl.cnf (100%) rename zonefile.cnf => dist/zonefile.cnf (100%) create mode 100755 install.sh diff --git a/.gitignore b/.gitignore index 0cd331a..40505c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .venv/ __pycache__ -jet-search.tar diff --git a/Dockerfile b/dist/Dockerfile similarity index 100% rename from Dockerfile rename to dist/Dockerfile diff --git a/nginx.cnf b/dist/nginx.cnf similarity index 100% rename from nginx.cnf rename to dist/nginx.cnf diff --git a/openssl.cnf b/dist/openssl.cnf similarity index 100% rename from openssl.cnf rename to dist/openssl.cnf diff --git a/zonefile.cnf b/dist/zonefile.cnf similarity index 100% rename from zonefile.cnf rename to dist/zonefile.cnf diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..00c3ed8 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +APP=jet-search +DOMAIN=jetsearch.com + +cd dist +docker build -t $APP . +openssl genrsa -out /etc/ssl/private/$APP.key 2048 +openssl req -new -key /etc/ssl/private/$APP.key -out /etc/ssl/certs/$APP.csr -config openssl.cnf +openssl x509 -req -in /etc/ssl/certs/$APP.csr -CA /root/ca.crt -CAkey /root/ca.key -CAcreateserial -out /etc/ssl/certs/$APP.crt -extfile openssl.cnf -extensions req_ext -days 500 -sha256 +cp nginx.cnf /etc/nginx/sites-enabled/$APP +echo "\nzone \"$DOMAIN\" {\n type master;\n file \"/etc/bind/db.$DOMAIN\";\n};" | tee -a /etc/bind/named.conf.local +cp zonefile.cnf /etc/bind/db.$DOMAIN +docker run -p 5000:5000 --name $APP --restart always -d $APP