From 8fba41884acfc52ba1e040c57e9e3dc54e42c129 Mon Sep 17 00:00:00 2001 From: Tobias Neitzel Date: Mon, 15 Jul 2024 16:15:51 +0200 Subject: [PATCH] Update dockerfile for frontend --- frontend/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index fd695f0..7b35ef0 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,7 @@ -FROM node:lts-alpine +########################################### +### Build Stage ### +########################################### +FROM node:lts-alpine AS frontend-builder WORKDIR /app COPY package*.json . @@ -13,7 +16,10 @@ COPY . . RUN chown -R rpv:rpv /app \ && su rpv -c "npm run build" -USER rpv:rpv -EXPOSE 5173 -CMD ["npm", "run", "dev", "--", "--host"] +########################################### +### Deploy Stage ### +########################################### +FROM nginx:alpine-slim + +COPY --from=frontend-builder /app/dist/. /usr/share/nginx/html