# develop stage
FROM node:20-alpine as develop-stage

WORKDIR /app
COPY package*.json ./
RUN yarn global add @quasar/cli && yarn --production=false
COPY . .

# build stage
FROM develop-stage as build-stage

#ARG API_URL
#ENV VUE_API_URL $API_URL

RUN yarn --production=false
RUN quasar build

# production stage
FROM nginx:1.25-alpine as production-stage
COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY --from=build-stage /app/dist/spa /app/html
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
