From 8d530cf10266414078cfd483b8daad963f1954f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20Tolm=C3=A1cs?= Date: Tue, 6 Aug 2024 13:21:20 +0200 Subject: [PATCH] fix: Docker build in CI (#8312) * Fix Docker build CI * Bump nginx-alpine version to 1.27 --- .dockerignore | 1 + Dockerfile | 2 +- excalidraw-app/vite.config.mts | 6 +++--- scripts/woff2/woff2-vite-plugins.js | 6 +++--- vitest.config.mts | 5 ++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8f757e505..6472839a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,6 +8,7 @@ !package.json !public/ !packages/ +!scripts/ !tsconfig.json !yarn.lock diff --git a/Dockerfile b/Dockerfile index 31487e287..2716803fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ARG NODE_ENV=production RUN yarn build:app:docker -FROM nginx:1.24-alpine +FROM nginx:1.27-alpine COPY --from=build /opt/node_app/excalidraw-app/build /usr/share/nginx/html diff --git a/excalidraw-app/vite.config.mts b/excalidraw-app/vite.config.mts index ee1256263..0e84fa537 100644 --- a/excalidraw-app/vite.config.mts +++ b/excalidraw-app/vite.config.mts @@ -26,10 +26,10 @@ export default defineConfig({ assetFileNames(chunkInfo) { if (chunkInfo?.name?.endsWith(".woff2")) { // put on root so we are flexible about the CDN path - return '[name]-[hash][extname]'; + return "[name]-[hash][extname]"; } - return 'assets/[name]-[hash][extname]'; + return "assets/[name]-[hash][extname]"; }, // Creating separate chunk for locales except for en and percentages.json so they // can be cached at runtime and not merged with @@ -44,7 +44,7 @@ export default defineConfig({ // Taking the substring after "locales/" return `locales/${id.substring(index + 8)}`; } - } + }, }, }, sourcemap: true, diff --git a/scripts/woff2/woff2-vite-plugins.js b/scripts/woff2/woff2-vite-plugins.js index 41a87abbb..f25488e86 100644 --- a/scripts/woff2/woff2-vite-plugins.js +++ b/scripts/woff2/woff2-vite-plugins.js @@ -58,7 +58,7 @@ module.exports.woff2BrowserPlugin = () => { style: normal; display: swap; } - + @font-face { font-family: "Assistant"; src: url(${OSS_FONTS_CDN}Assistant-Medium-DrcxCXg3.woff2) @@ -68,7 +68,7 @@ module.exports.woff2BrowserPlugin = () => { style: normal; display: swap; } - + @font-face { font-family: "Assistant"; src: url(${OSS_FONTS_CDN}Assistant-SemiBold-SCI4bEL9.woff2) @@ -78,7 +78,7 @@ module.exports.woff2BrowserPlugin = () => { style: normal; display: swap; } - + @font-face { font-family: "Assistant"; src: url(${OSS_FONTS_CDN}Assistant-Bold-gm-uSS1B.woff2) diff --git a/vitest.config.mts b/vitest.config.mts index 03a337e80..cd822ca3b 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -2,9 +2,8 @@ import { defineConfig } from "vitest/config"; import { woff2BrowserPlugin } from "./scripts/woff2/woff2-vite-plugins"; export default defineConfig({ - plugins: [ - woff2BrowserPlugin(), - ], + // @ts-ignore + plugins: [woff2BrowserPlugin()], test: { setupFiles: ["./setupTests.ts"], globals: true,