From cd1d785ab31607060b8c2021e512ff4bc33bdf9c Mon Sep 17 00:00:00 2001 From: Clifton Palmer Date: Tue, 21 Feb 2023 10:56:41 -0600 Subject: [PATCH] Merged kanboard and public share with nginx proxy for easy deployment --- .gitignore | 1 + docker-compose.yml | 52 ++++++++++++++++++++++++++++------ nginx.conf => proxy/nginx.conf | 7 +++-- readme.txt | 5 ---- 4 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 .gitignore rename nginx.conf => proxy/nginx.conf (64%) delete mode 100644 readme.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml index b646b69..12ff6bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,14 @@ +# requires variable config loading, such as: +# docker stack deploy -c <(docker-compose config) proxy +# +# also needs an .env file with some variables like: +# LOCAL_STORAGE=/mnt/data2/purplebirdman/art +# IPV4_WAN=public.purplebirdman.com + version: '3' -networks: - proxy: - external: - name: proxy services: - nginx: + proxy: image: nginx:1.17 - restart: on-failure deploy: restart_policy: condition: on-failure @@ -14,12 +16,44 @@ services: max_attempts: 5 window: 10s volumes: - - ./nginx.conf:/etc/nginx/nginx.conf + - ./proxy/nginx.conf:/etc/nginx/nginx.conf environment: - NGINX_HOST=purplebirdman.com - NGINX_PORT=80 ports: - 80:80 - 443:443 - networks: - - proxy + kanboard: + image: kanboard/kanboard:v1.2.26 + deploy: + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 5 + window: 10s + volumes: + - kanboard_data:/var/www/app/data + - kanboard_plugins:/var/www/app/plugins + - kanboard_ssl:/etc/nginx/ssl + public: + image: cliftonpalmer/public:1.0.0 + volumes: + - ${LOCAL_STORAGE}:/storage + - public_data:/usr/local/apache2/htdocs + environment: + - PUBLIC_ROOT_DIR=/storage + - PUBLIC_LINK_DIR=/usr/local/apache2/htdocs + - PUBLIC_HTTP_URI=http://${IPV4_WAN} +volumes: + kanboard_data: + driver: local + driver_opts: + o: bind + type: none + device: /mnt/kanboard_data + kanboard_plugins: + driver: local + kanboard_ssl: + driver: local + public_data: + driver: local diff --git a/nginx.conf b/proxy/nginx.conf similarity index 64% rename from nginx.conf rename to proxy/nginx.conf index f990def..2698a6e 100644 --- a/nginx.conf +++ b/proxy/nginx.conf @@ -6,17 +6,18 @@ events { http { server { - server_name kanban.purplebirdman.com; + listen 80 default_server; + server_name kanban.purplebirdman.com; client_max_body_size 20M; location / { - proxy_pass http://kanboard_web; + proxy_pass http://kanboard; proxy_set_header Host $host; } } server { server_name public.purplebirdman.com; location / { - proxy_pass http://public_web; + proxy_pass http://public; proxy_set_header Host $host; } } diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 9782c06..0000000 --- a/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -My nginx server for managing my web stuff. Needs a proxy overlay network that all the web stuff sits on: - -``` -docker network create --attachable --driver overlay proxy -``` -- 2.47.2