diff --git a/.dockerignore b/.dockerignore index 461e021f5..83ead5fe7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,4 @@ dockerfile .git screenshot.png node_modules +dummy-data diff --git a/Dockerfile b/Dockerfile index ab2d71aa9..327e9242b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ # build stage FROM node:lts-alpine as build-stage +ARG SUBFOLDER "" + WORKDIR /app COPY package*.json ./ diff --git a/src/App.vue b/src/App.vue index 25e943f7d..cd7b97efb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -208,7 +208,7 @@ export default { if (this.currentPage !== "default") { let pageConfig = await this.getConfig( - `assets/${this.currentPage}.yml` + `${import.meta.env.BASE_URL}/assets/${this.currentPage}.yml` ); config = Object.assign(config, pageConfig); } @@ -230,7 +230,7 @@ export default { this.createStylesheet(stylesheet); } }, - getConfig: function (path = "assets/config.yml") { + getConfig: function (path = `${import.meta.env.BASE_URL}/assets/config.yml`) { return fetch(path).then((response) => { if (response.status == 404 || response.redirected) { this.configNotFound = true; diff --git a/vite.config.js b/vite.config.js index 15ff45745..b6b188ab1 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,7 +6,7 @@ import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ - base: "", + base: process.env.SUBFOLDER ?? "", build: { assetsDir: "resources", },