From d668067fee4f77eca10e67745ffcc5aad69e0cb8 Mon Sep 17 00:00:00 2001 From: summersamara Date: Wed, 22 Nov 2023 20:14:08 +0100 Subject: [PATCH] fix docker development environment: Add npm package to Docker image + Add vite server config --- Dockerfile | 2 +- vite.config.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fba037c87..607762c0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM elixir:1.13.4-alpine -RUN apk add --no-cache inotify-tools postgresql-client file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git python3 +RUN apk add --no-cache inotify-tools postgresql-client file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git python3 npm RUN mix local.hex --force && mix local.rebar --force diff --git a/vite.config.js b/vite.config.js index a45a3ba48..46bc61bc2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,7 +3,7 @@ import { defineConfig } from "vite"; import path from "path"; import { VitePWA } from "vite-plugin-pwa"; import { visualizer } from "rollup-plugin-visualizer"; -import svgLoader from 'vite-svg-loader'; +import svgLoader from "vite-svg-loader"; export default defineConfig(({ command }) => { const isDev = command !== "build"; @@ -84,6 +84,9 @@ export default defineConfig(({ command }) => { return { plugins, build, + server: { + host: isDev ? "0.0.0.0" : "localhost", + }, resolve: { alias: { "@": path.resolve(__dirname, "./src"),