Files
titan_react_node_sqllite/Dockerfile
T
digifoxkurama 3d43b3c206
CI/CD Pipeline / Build & Validate (push) Canceled after 0s
CI/CD Pipeline / Docker Build Validation (push) Canceled after 0s
fix: copy 3dmodels directory to Nginx html folder in production build
2026-08-28 18:20:23 +05:30

34 lines
769 B
Docker

# Base image
FROM node:20-alpine AS base
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Development stage
FROM base AS development
# Copy all project files
COPY . .
# Expose Vite's default port
EXPOSE 3000
# Run the development server
CMD ["npm", "run", "dev"]
# Build stage
FROM base AS build
COPY . .
RUN npm run build
# Production stage
FROM nginx:alpine AS production
# Copy built assets from the build stage to Nginx
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/3dmodels /usr/share/nginx/html/3dmodels
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 for Nginx
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]