FROM node:23.11.1-alpine3.22 as build

WORKDIR ~/app

COPY ./ ./
RUN npm i

COPY src tsconfig.json webpack.config.js @types ./

RUN npm run build

FROM nginx:latest

COPY --from=build ~/app/dist /usr/share/nginx/html

EXPOSE 8080:80