From 0f88acb798c7f35004226c889f4ee18abdb192d7 Mon Sep 17 00:00:00 2001 From: Helen Root Date: Wed, 23 Oct 2024 12:42:59 +0200 Subject: [PATCH] 2024-frontend working --- 2024-frontend/Dockerfile | 8 ++++---- 2024-frontend/vite.config.js | 3 +++ compose.yaml | 8 +++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/2024-frontend/Dockerfile b/2024-frontend/Dockerfile index 25334ad9f..e7e72eea6 100644 --- a/2024-frontend/Dockerfile +++ b/2024-frontend/Dockerfile @@ -2,11 +2,11 @@ FROM ma-cantine-server WORKDIR /app/2024-frontend -# only copy the dependencies file first to make sure the step is only -# ran if either of these files explicitly change. -# COPY package.json package-lock.json ./ USER root +# NB: this wont reinstall on build, must rebuild server image first RUN npm install -CMD [ "npm", "run", "dev" ] \ No newline at end of file +EXPOSE 5173 + +CMD [ "npm", "run", "dev" ] diff --git a/2024-frontend/vite.config.js b/2024-frontend/vite.config.js index c0e2d18bd..217281c94 100644 --- a/2024-frontend/vite.config.js +++ b/2024-frontend/vite.config.js @@ -46,4 +46,7 @@ export default defineConfig({ }, ], }, + server: { + host: "0.0.0.0", + }, }) diff --git a/compose.yaml b/compose.yaml index e5c3e7418..1c41b178f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -22,7 +22,7 @@ services: condition: service_healthy frontend: build: - context: 'frontend' + context: frontend image: ma-cantine-front volumes: - "./frontend/:/app" @@ -31,9 +31,11 @@ services: - 8080:8080 2024-frontend: build: - context: ./ - dockerfile: 2024-frontend/Dockerfile + context: 2024-frontend image: ma-cantine-2024-front + volumes: + - "./2024-frontend:/app/2024-frontend" + - "/app/2024-frontend/node_modules" ports: - 5173:5173 env_file: