Skip to content

Commit

Permalink
# add openwrt content svc
Browse files Browse the repository at this point in the history
  • Loading branch information
czy21 committed Oct 15, 2024
1 parent 9695218 commit 838a959
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
22 changes: 21 additions & 1 deletion server/docker/app/traefik/node/nas/conf/conf.d/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,24 @@ http:
routers:
alist:
rule: Host(`alist.czy21-internal.com`)
service: alist@docker
service: alist@docker
openwrt-download:
rule: Host(`openwrt-download.czy21-internal.com`)
service: openwrt-content@docker
middlewares:
- openwrt-download-proxy
openwrt-firmware:
rule: Host(`openwrt-firmware.czy21-internal.com`)
service: openwrt-content@docker
middlewares:
- openwrt-firmware-proxy

middlewares:
openwrt-download-proxy:
replacePathRegex:
regex: "^/(.*)/"
replacement: "/download/${1}/"
openwrt-firmware-proxy:
replacePathRegex:
regex: "^/(.*)/"
replacement: "/download/${1}/"
13 changes: 13 additions & 0 deletions server/docker/os/ubuntu-openwrt/conf/nginx/conf.d/openwrt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

server {
listen 80;
server_name localhost;

location /firmware/ {
root /data/openwrt/firmware/;
}

location /download/ {
root /data/openwrt/download/;
}
}
23 changes: 20 additions & 3 deletions server/docker/os/ubuntu-openwrt/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
version: "3.9"

x-traefik-label: &traefik-label
traefik.enable: true
traefik.http.routers.openwrt-content.service: openwrt-content
traefik.http.services.openwrt-content.loadbalancer.server.port: 80

services:
{{ param_role_name }}:
openwrt-builder:
image: {{ param_registry_url }}/{{ param_registry_dir }}/{{ param_role_name }}
pull_policy: always
container_name: {{ param_role_name }}
hostname: {{ param_role_name }}
container_name: openwrt-builder
hostname: openwrt-builder
user: {{ param_user_ops }}
tty: true
volumes:
- {{ param_docker_data }}/{{ param_role_name }}/data/:/data/
restart: always

openwrt-content:
image: nginx:1.27.0-alpine
labels:
<<: *traefik-label
pull_policy: always
container_name: openwrt-content
hostname: openwrt-builder
volumes:
- {{ param_docker_data }}/{{ param_role_name }}/conf/nginx/conf.d/:/etc/nginx/conf.d/
- {{ param_docker_data }}/{{ param_role_name }}/data/:/data/
restart: always

0 comments on commit 838a959

Please sign in to comment.