Spaces:
Sleeping
Sleeping
FROM node:18-alpine AS build | |
# Set working directory | |
WORKDIR /app | |
# Copy the viewer directory with all its contents | |
COPY viewer/ . | |
# Install dependencies | |
RUN npm install | |
# Build the application | |
RUN npm run build || (echo "Build failed. Check the error messages above." && exit 1) | |
# Production stage | |
FROM nginx:alpine | |
# Copy built assets from build stage | |
COPY --from=build /app/dist /usr/share/nginx/html | |
# Copy nginx configuration | |
COPY viewer/nginx.conf /etc/nginx/conf.d/default.conf | |
# Expose port | |
EXPOSE 7860 | |
# Start nginx | |
CMD ["nginx", "-g", "daemon off;"] |