From 4c219c00848528a3a15b4b4adc05be274e193911 Mon Sep 17 00:00:00 2001 From: MangoPig Date: Sun, 14 Jun 2026 15:23:14 +0100 Subject: [PATCH] Feat: Allowed hosts configuration --- Frontend/Dockerfile | 22 +++------------------- Frontend/src/styles/tools/_functions.scss | 5 ----- Frontend/vite.config.ts | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 26 deletions(-) delete mode 100644 Frontend/src/styles/tools/_functions.scss diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index b055f2b..247e45b 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -16,27 +16,11 @@ FROM dependencies AS development ENV NODE_ENV=development ENV PORT=3333 +ARG ALLOWED_HOSTS +ENV ALLOWED_HOSTS=${ALLOWED_HOSTS} + COPY . . EXPOSE 3333 CMD ["pnpm", "dev", "--host", "0.0.0.0", "--port", "3333"] - -FROM dependencies AS build - -ENV NODE_ENV=production - -COPY . . - -RUN pnpm build - -FROM base AS production - -ENV NODE_ENV=production -ENV PORT=3333 - -COPY --from=build /app /app - -EXPOSE 3333 - -CMD ["pnpm", "start", "--host", "0.0.0.0", "--port", "3333"] diff --git a/Frontend/src/styles/tools/_functions.scss b/Frontend/src/styles/tools/_functions.scss deleted file mode 100644 index 769db76..0000000 --- a/Frontend/src/styles/tools/_functions.scss +++ /dev/null @@ -1,5 +0,0 @@ -/* Path: Frontend/src/styles/tools/_functions.scss */ - -@function rem($pixels, $base: 16) { - @return ($pixels / $base) * 1rem; -} diff --git a/Frontend/vite.config.ts b/Frontend/vite.config.ts index 6d31d21..cfba717 100644 --- a/Frontend/vite.config.ts +++ b/Frontend/vite.config.ts @@ -5,13 +5,25 @@ import { defineConfig } from "vite"; import { solidStart } from "@solidjs/start/config"; +const extraAllowedHosts = (process.env.ALLOWED_HOSTS ?? "") + .split(",") + .map((host) => host.trim()) + .filter(Boolean); + export default defineConfig({ + plugins: [solidStart(), nitro()], + server: { + allowedHosts: ["localhost", ...extraAllowedHosts], + }, + preview: { + allowedHosts: ["localhost", ...extraAllowedHosts], + }, + css: { preprocessorOptions: { scss: { - additionalData: `@use "/src/styles/tools/functions" as *;\n@use "/src/styles/tools/breakpoints" as *;\n@use "/src/styles/tools/mixins" as *;\n`, + additionalData: `@use "/src/styles/tools/breakpoints" as *;\n@use "/src/styles/tools/mixins" as *;\n`, }, }, }, - plugins: [solidStart(), nitro()], });