Modified Dockerfile to add script to modify env vars

This commit is contained in:
Frédérick Pruneau 2026-02-23 14:00:50 -05:00
parent 8a321cd88d
commit 4dac626b81

View File

@ -2,13 +2,10 @@
FROM node:22 AS build FROM node:22 AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Set environment variables
ARG BACKEND_URL
ENV VITE_TARGO_BACKEND_URL=$BACKEND_URL
# Install dependencies # Install dependencies
RUN npm install -g @quasar/cli RUN npm install -g @quasar/cli
COPY . . COPY . .
RUN npm install RUN npm ci
RUN npm run build RUN npm run build
# Step 2 - Move Applicatin to Nginx # Step 2 - Move Applicatin to Nginx
@ -16,5 +13,12 @@ FROM nginx:alpine
COPY --from=build /app/dist/spa /usr/share/nginx/html COPY --from=build /app/dist/spa /usr/share/nginx/html
RUN mkdir /usr/share/nginx/html/src RUN mkdir /usr/share/nginx/html/src
COPY --from=build /app/src /usr/share/nginx/html/src COPY --from=build /app/src /usr/share/nginx/html/src
COPY env.sh /docker-entrypoint.d/env.sh
RUN dos2unix /docker-entrypoint.d/env.sh
RUN chmod +x /docker-entrypoint.d/env.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]