From ea3b336541d1e10fe171551573cd435a4d21e01b Mon Sep 17 00:00:00 2001 From: ludelanier Date: Tue, 14 May 2024 16:53:57 +0200 Subject: [PATCH] fix images --- Dockerfile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index de299a6..e047020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,22 @@ -# build stage -FROM node:lts-hydrogen AS build-stage +FROM node:lts-alpine + +# install simple http server for serving static content +RUN npm install -g http-server + +# make the 'app' folder the current working directory WORKDIR /app + +# copy both 'package.json' and 'package-lock.json' (if available) COPY package*.json ./ + +# install project dependencies RUN npm install + +# copy project files and folders to the current working directory (i.e. 'app' folder) COPY . . + +# build app for production with minification RUN npm run build -FROM nginx:stable-alpine AS production-stage -COPY nginx.conf /etc/nginx/conf.d/default.conf -COPY --from=build-stage /app/dist /usr/share/nginx/html -CMD ["nginx", "-g", "daemon off;"] +EXPOSE 8080 +CMD [ "http-server", "dist" ] \ No newline at end of file