From: Clifton Palmer Date: Tue, 21 Feb 2023 16:56:41 +0000 (-0600) Subject: Merged kanboard and public share with nginx proxy for easy deployment X-Git-Url: http://git.purplebirdman.com/proxy.git/commitdiff_plain/cd1d785ab31607060b8c2021e512ff4bc33bdf9c Merged kanboard and public share with nginx proxy for easy deployment --- 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/nginx.conf deleted file mode 100644 index f990def..0000000 --- a/nginx.conf +++ /dev/null @@ -1,23 +0,0 @@ -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - server { - server_name kanban.purplebirdman.com; - client_max_body_size 20M; - location / { - proxy_pass http://kanboard_web; - proxy_set_header Host $host; - } - } - server { - server_name public.purplebirdman.com; - location / { - proxy_pass http://public_web; - proxy_set_header Host $host; - } - } -} diff --git a/proxy/nginx.conf b/proxy/nginx.conf new file mode 100644 index 0000000..2698a6e --- /dev/null +++ b/proxy/nginx.conf @@ -0,0 +1,24 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + server { + listen 80 default_server; + server_name kanban.purplebirdman.com; + client_max_body_size 20M; + location / { + proxy_pass http://kanboard; + proxy_set_header Host $host; + } + } + server { + server_name public.purplebirdman.com; + location / { + 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 -```