From 9e2f8fbf1f7bff034702b0a1ad4908a5b26d2494 Mon Sep 17 00:00:00 2001 From: Joshua Lanese Date: Tue, 15 Oct 2024 00:02:28 -0700 Subject: [PATCH] Dashboard docker path routing --- .github/workflows/dashboard-release-docker.yml | 2 +- dashboard/{ => docker}/Dockerfile | 3 +++ dashboard/docker/README.md | 6 ++++++ dashboard/docker/server.nginx.conf | 10 ++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) rename dashboard/{ => docker}/Dockerfile (59%) create mode 100644 dashboard/docker/README.md create mode 100644 dashboard/docker/server.nginx.conf diff --git a/.github/workflows/dashboard-release-docker.yml b/.github/workflows/dashboard-release-docker.yml index ae80e722..4e020eee 100644 --- a/.github/workflows/dashboard-release-docker.yml +++ b/.github/workflows/dashboard-release-docker.yml @@ -58,7 +58,7 @@ jobs: with: context: ./dashboard platforms: linux/amd64,linux/arm64 - file: ./dashboard/Dockerfile + file: ./dashboard/docker/Dockerfile push: true tags: | ${{ steps.string_tag.outputs.lowercase }}:latest diff --git a/dashboard/Dockerfile b/dashboard/docker/Dockerfile similarity index 59% rename from dashboard/Dockerfile rename to dashboard/docker/Dockerfile index cc6172e2..264ecb1b 100644 --- a/dashboard/Dockerfile +++ b/dashboard/docker/Dockerfile @@ -15,3 +15,6 @@ FROM nginx WORKDIR /usr/share/nginx/html COPY --from=build /app/out/ ./ +# Replace the default server configuration, but leave the overall nginx +# configuration +COPY ./docker/server.nginx.conf /etc/nginx/conf.d/default.conf diff --git a/dashboard/docker/README.md b/dashboard/docker/README.md new file mode 100644 index 00000000..fac80844 --- /dev/null +++ b/dashboard/docker/README.md @@ -0,0 +1,6 @@ +## Self Hosting with Docker +Example: +```shell +docker run -d -p 3001:80 --name lodestone-dashboard ghcr.io/lodestone-team/lodestone_dashboard +``` +And then the dashboard will be available at http://localhost:3001 diff --git a/dashboard/docker/server.nginx.conf b/dashboard/docker/server.nginx.conf new file mode 100644 index 00000000..6118cf96 --- /dev/null +++ b/dashboard/docker/server.nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + + location / { + try_files $uri $uri/ /index.html; + } +}