From 78a535d3a06ef5a10a4ca88322f374ddd85fd2ab Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Mon, 6 Jan 2025 13:10:45 -0700 Subject: [PATCH] Refactoring and updating code for deployment to a caprover server --- Dockerfile | 3 +++ captain-definition | 4 ++++ jnf.me.conf | 3 --- jnf.me.sconf | 25 ------------------------- local-test.sh | 4 ++++ nginx.conf | 14 ++++++++++++++ 6 files changed, 25 insertions(+), 28 deletions(-) create mode 100644 Dockerfile create mode 100644 captain-definition delete mode 100644 jnf.me.conf delete mode 100644 jnf.me.sconf create mode 100644 local-test.sh create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99f2415 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM docker.io/nginx:1-alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY ./www /www \ No newline at end of file diff --git a/captain-definition b/captain-definition new file mode 100644 index 0000000..04859b5 --- /dev/null +++ b/captain-definition @@ -0,0 +1,4 @@ +{ + "schemaVersion": 2, + "dockerfilePath": "./Dockerfile" +} \ No newline at end of file diff --git a/jnf.me.conf b/jnf.me.conf deleted file mode 100644 index bece0f7..0000000 --- a/jnf.me.conf +++ /dev/null @@ -1,3 +0,0 @@ -location / { - return 301 https://www.jnf.me$request_uri; -} \ No newline at end of file diff --git a/jnf.me.sconf b/jnf.me.sconf deleted file mode 100644 index 708728e..0000000 --- a/jnf.me.sconf +++ /dev/null @@ -1,25 +0,0 @@ -if ($host != www.jnf.me) { - return 301 https://www.jnf.me$request_uri; -} - -location / { - index index.php index.html index.htm; - try_files $uri /index.html; -} - -location /lucy { - index index.php index.html index.htm; - try_files $uri /lucy.html; -} - -location ~ \.php$ { - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - if (!-f $document_root$fastcgi_script_name) { - return 404; - } - - fastcgi_pass unix:/run/php/php7.4-fpm-ptools.jaywll.co.sock; - fastcgi_index index.php; - include /etc/nginx/fastcgi_params; - include /home/jason/conf/web/ptools.jaywll.co/nginx.fastcgi_cache.conf*; -} \ No newline at end of file diff --git a/local-test.sh b/local-test.sh new file mode 100644 index 0000000..2556f96 --- /dev/null +++ b/local-test.sh @@ -0,0 +1,4 @@ +# Script used to spin up a local webserver for development & testing + +#!/bin/bash +podman run -it --rm -p 3000:80 $(podman build -q .) \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..fc39fec --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + root /www; + + location / { + index index.html; + try_files $uri /index.html; + } + + location /lucy { + index index.html; + try_files $uri /lucy.html; + } +} \ No newline at end of file