diff --git a/Dockerfile b/Dockerfile index b3447b9..8fa98ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,18 @@ # syntax=docker/dockerfile:1.4 # Build stage -FROM node:lts AS build +FROM node:18-alpine AS build WORKDIR /app -# Set environment variables to help with sharp installation -ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1 -ENV npm_config_sharp_binary_host="https://npmjs.org/mirrors/sharp" -ENV npm_config_sharp_libvips_binary_host="https://npmjs.org/mirrors/sharp-libvips" +# Install build dependencies +RUN apk add --no-cache python3 make g++ # Copy package files COPY package.json package-lock.json ./ -# Install dependencies with legacy peer deps and increased timeout -# Use --no-optional to skip optional dependencies that might cause issues -RUN npm config set fetch-timeout 600000 && \ - npm config set fetch-retry-mintimeout 10000 && \ - npm config set fetch-retry-maxtimeout 60000 && \ - npm install --legacy-peer-deps --no-optional --verbose +# Install dependencies +RUN npm install --legacy-peer-deps # Copy source code COPY . . @@ -26,17 +20,15 @@ COPY . . # Build the Gatsby app RUN npm run build -# Production stage with Nginx +# Production stage FROM nginx:alpine AS production -# Create simple nginx config for Gatsby with client-side routing support -RUN echo 'server { listen 80; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 1y; add_header Cache-Control "public, immutable"; } }' > /etc/nginx/conf.d/default.conf +# Copy nginx config +RUN echo 'server { listen 80; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf -# Copy built Gatsby files (builds to 'public' directory) +# Copy built files COPY --from=build /app/public /usr/share/nginx/html -# Expose port 80 EXPOSE 80 -# Start nginx CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/src/components/Style2/ServicesDetails/Details.jsx b/src/components/Style2/ServicesDetails/Details.jsx index 8f8d4ed..e26e215 100644 --- a/src/components/Style2/ServicesDetails/Details.jsx +++ b/src/components/Style2/ServicesDetails/Details.jsx @@ -9,14 +9,14 @@ const Details = ({ service }) => {
- {service.overview} + {service?.overview || 'No overview available'}
No processes available
}{feature.name}: {feature.description}
- ))} - + )) ||No features available
}