Use package.json

This commit is contained in:
TheMaddax 2024-11-23 18:06:18 -06:00
parent b8ec5a5dd3
commit a5aace56d2

View file

@ -4,20 +4,14 @@ ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV} ENV NODE_ENV=${NODE_ENV}
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Install all dependencies including dev dependencies for types
RUN npm install RUN npm install
RUN npm install -g typescript
# Install type definitions
RUN npm install --save-dev @types/react-dom @types/vite @vitejs/plugin-react
COPY . . COPY . .
RUN npm run build RUN npm run build
# Production stage remains the same # Production stage
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1 CMD curl -f http://localhost/ || exit 1
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]