From f887455d663426db5811fca51e4e0fb23e4a3dea Mon Sep 17 00:00:00 2001 From: summersamara Date: Tue, 16 May 2023 20:57:06 +0200 Subject: [PATCH] make vite server reachable from outside the container [fix #1225] https://framagit.org/framasoft/mobilizon/-/issues/1225 --- Dockerfile | 1 + docker-compose.yml | 1 + js/vite.config.js | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 91557dc2b..c3e778bbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,3 +7,4 @@ RUN mix local.hex --force && mix local.rebar --force WORKDIR /app EXPOSE 4000 +EXPOSE 5173 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9b75aad9a..bba75a6f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: - ".:/app" ports: - 4000:4000 + - 5173:5173 depends_on: - postgres environment: diff --git a/js/vite.config.js b/js/vite.config.js index 184f0ac91..97a0ff2eb 100644 --- a/js/vite.config.js +++ b/js/vite.config.js @@ -30,6 +30,9 @@ export default defineConfig(({ command }) => { }), visualizer(), ], + server: { + host: (isDev ? "0.0.0.0" : "localhost") + }, build: { manifest: true, outDir: path.resolve(__dirname, "../priv/static"),