FROM node:22-alpine AS build

WORKDIR /var/www/comal-pagos.frontend

COPY package*.json ./

RUN npm install

COPY . .

COPY install.sh /usr/local/bin/install.sh
RUN chmod +x /usr/local/bin/install.sh

ENTRYPOINT ["/usr/local/bin/install.sh"]
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]