- Implemented getWarehouseById method in warehouseService to fetch warehouse details by ID. - Added new types for warehouse inventory management in warehouse.d.ts and warehouse.inventory.d.ts. - Created WarehouseAddInventory.vue component for handling inventory entries with serial number management. - Developed inventoryWarehouseServices for adding inventory through API. - Updated router to include the new inventory management component. - Added Docker configuration files for production deployment. - Created Nginx configuration for serving the application. - Added .dockerignore and .env.production for environment-specific settings.
33 lines
668 B
Docker
33 lines
668 B
Docker
# Stage 1: Build the application
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files first to leverage Docker cache
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
ARG VITE_API_URL
|
|
ENV VITE_API_URL=$VITE_API_URL
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve the application with Nginx
|
|
FROM nginx:alpine AS production
|
|
|
|
# Copy the built artifacts from the builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom Nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start Nginx
|
|
CMD ["nginx", "-g", "daemon off;"] |