diff --git a/.dockerignore b/.dockerignore index 11cc0bbce0..cbc18c6cee 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,6 +3,9 @@ node_modules npm-debug.log .git .gitignore +.devcontainer/ +.github/ +.vscode/ /config /audiobooks /audiobooks2 @@ -11,6 +14,8 @@ npm-debug.log dev.js test/ /client/.nuxt/ +/client/.output/ /client/dist/ /dist/ +/build/ /deploy/ \ No newline at end of file diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f88db2ed13..ceefc3b3eb 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: setup nade + - name: setup node uses: actions/setup-node@v3 with: node-version: 16 @@ -27,7 +27,7 @@ jobs: - name: build client working-directory: client - run: npm run generate + run: npm run build - name: get server dependencies run: npm ci --only=production diff --git a/.gitignore b/.gitignore index 25a8a77460..239b9544b8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /metadata/ test/ /client/.nuxt/ +/client/.output/ /client/dist/ /dist/ /deploy/ diff --git a/Dockerfile b/Dockerfile index fe2e005981..ad37167761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,19 @@ ### STAGE 0: Build client ### FROM node:16-alpine AS build WORKDIR /client -COPY /client /client + +COPY /client/package*.json /client/ RUN npm ci && npm cache clean --force -RUN npm run generate + +COPY /client /client +RUN npm run build ### STAGE 1: Build server ### FROM sandreas/tone:v0.1.5 AS tone FROM node:16-alpine +WORKDIR /app + ENV NODE_ENV=production RUN apk update && \ apk add --no-cache --update \ @@ -17,11 +22,13 @@ RUN apk update && \ ffmpeg COPY --from=tone /usr/local/bin/tone /usr/local/bin/ -COPY --from=build /client/dist /client/dist -COPY index.js package* / -COPY server server +COPY package* ./ -RUN npm ci --only=production +RUN npm ci --omit=dev + +COPY index.js package* ./ +COPY server server +COPY --from=build /client/.output ./client/.output EXPOSE 80 HEALTHCHECK \ diff --git a/client/assets/app.css b/client/assets/app.css index f8e515212d..cc9e59f911 100644 --- a/client/assets/app.css +++ b/client/assets/app.css @@ -5,7 +5,7 @@ @import './absicons.css'; :root { - --bookshelf-texture-img: url(/textures/wood_default.jpg); + --bookshelf-texture-img: url(~static/textures/wood_default.jpg); --bookshelf-divider-bg: linear-gradient(180deg, rgba(149, 119, 90, 1) 0%, rgba(103, 70, 37, 1) 17%, rgba(103, 70, 37, 1) 88%, rgba(71, 48, 25, 1) 100%); } diff --git a/client/components/app/ConfigSideNav.vue b/client/components/app/ConfigSideNav.vue index af4645f4bb..52565060b4 100644 --- a/client/components/app/ConfigSideNav.vue +++ b/client/components/app/ConfigSideNav.vue @@ -10,12 +10,12 @@
- -
+ + -
-
-

v{{ $config.version }}

+
+
+

v{{ $config.public.version }}

{{ Source }}

diff --git a/client/components/app/SideRail.vue b/client/components/app/SideRail.vue index 995f4c2322..b11e0357b6 100644 --- a/client/components/app/SideRail.vue +++ b/client/components/app/SideRail.vue @@ -114,12 +114,12 @@
-

v{{ $config.version }}

- Update -

{{ Source }}

-
+

v{{ $config.public.version }}

+ Update +

{{ Source }}

+
- +
diff --git a/client/components/covers/AuthorImage.vue b/client/components/covers/AuthorImage.vue index c3cafaea03..311efb314c 100644 --- a/client/components/covers/AuthorImage.vue +++ b/client/components/covers/AuthorImage.vue @@ -58,7 +58,7 @@ export default { if (!this.imagePath) return null if (process.env.NODE_ENV !== 'production') { // Testing - return `http://localhost:3333${this.$config.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` + return `http://localhost:3333${this.$config.public.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` } return `/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` } diff --git a/client/components/modals/player/QueueItemRow.vue b/client/components/modals/player/QueueItemRow.vue index 2acc4a6356..ccf4222fdf 100644 --- a/client/components/modals/player/QueueItemRow.vue +++ b/client/components/modals/player/QueueItemRow.vue @@ -55,7 +55,7 @@ export default { return this.item.coverPath }, coverUrl() { - if (!this.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg` + if (!this.coverPath) return `${this.$config.public.routerBasePath}/book_placeholder.jpg` return this.$store.getters['globals/getLibraryItemCoverSrcById'](this.libraryItemId) }, bookCoverAspectRatio() { diff --git a/client/components/modals/rssfeed/OpenCloseModal.vue b/client/components/modals/rssfeed/OpenCloseModal.vue index f5fe647ca3..5c22e8c8bb 100644 --- a/client/components/modals/rssfeed/OpenCloseModal.vue +++ b/client/components/modals/rssfeed/OpenCloseModal.vue @@ -137,7 +137,7 @@ export default { slug: this.newFeedSlug, metadataDetails: this.metadataDetails } - if (this.$isDev) payload.serverAddress = `http://localhost:3333${this.$config.routerBasePath}` + if (this.$isDev) payload.serverAddress = `http://localhost:3333${this.$config.public.routerBasePath}` console.log('Payload', payload) this.$axios diff --git a/client/components/readers/EpubReader.vue b/client/components/readers/EpubReader.vue index 20b8f203c5..eab8644f2e 100644 --- a/client/components/readers/EpubReader.vue +++ b/client/components/readers/EpubReader.vue @@ -1,26 +1,26 @@