From: Clifton Palmer Date: Mon, 16 Dec 2024 14:32:05 +0000 (-0600) Subject: Squashed commit of the following: X-Git-Url: http://git.purplebirdman.com/proxy.git/commitdiff_plain/10b425a069c89b7e516b1f417279094cb01ef6b0?hp=b7f6ea3e64e6ee902036f9e6721ceb0e6e8a1a67 Squashed commit of the following: * Updated to nginx:1.27-alpine * Removed old instructions * Removed unnecessary extra conf file * Removed junk scripts --- diff --git a/README.md b/README.md index 12e943f..e4a3f74 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,8 @@ Routing nginx service for docker swarm # notes when adding to conf.d After adding a new .conf file, replicas must be scaled to 0 then to 1 for change to take effect + +# deploying +``` +docker stack deploy -c <(docker-compose config) proxy +``` diff --git a/conf.d/git.conf b/conf.d/git.conf new file mode 100644 index 0000000..1711ab9 --- /dev/null +++ b/conf.d/git.conf @@ -0,0 +1,11 @@ +server { + listen 443 ssl; + server_name git.purplebirdman.com; + ssl_certificate /etc/letsencrypt/live/purplebirdman.com-0001/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/purplebirdman.com-0001/privkey.pem; + + location / { + proxy_pass http://gitweb_web; + proxy_set_header Host $host; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index a08d482..7007838 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,12 @@ -# requires variable config loading, such as: -# docker stack deploy -c <(docker-compose config) proxy -# -# also needs an .env file with some variables! - version: '3' networks: proxy: external: true services: web: - image: nginx:1.17 + image: nginx:1.27-alpine volumes: - /etc/letsencrypt/:/etc/letsencrypt/ - - ./nginx.conf:/etc/nginx/nginx.conf - ./conf.d/:/etc/nginx/conf.d/ environment: - NGINX_HOST=purplebirdman.com diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 8f66c5c..0000000 --- a/nginx.conf +++ /dev/null @@ -1,31 +0,0 @@ -user nginx; -worker_processes 1; - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - #gzip on; - - include /etc/nginx/conf.d/*.conf; -} diff --git a/script/certbot-fetch.sh b/script/certbot-fetch.sh deleted file mode 100755 index 9b4267d..0000000 --- a/script/certbot-fetch.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# source: https://eff-certbot.readthedocs.io/en/latest/install.html#alternative-1-docker - -docker run -it --rm --name certbot \ - -v "/etc/letsencrypt:/etc/letsencrypt" \ - -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ - -v "$HOME/.aws:/aws" \ - -e "AWS_CONFIG_FILE=/aws/config" \ - -e "AWS_SHARED_CREDENTIALS_FILE=/aws/credentials" \ - -p 80:80 \ - certbot/dns-route53 certonly diff --git a/script/deploy.sh b/script/deploy.sh deleted file mode 100755 index 9e5489b..0000000 --- a/script/deploy.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -docker stack deploy -c <(docker-compose config) proxy