Spaces:
Sleeping
Sleeping
File size: 856 Bytes
803d604 e4c6a7c 803d604 e4c6a7c 803d604 e4c6a7c 803d604 e4c6a7c 803d604 e4c6a7c 803d604 4a01764 803d604 9a42d1f e4c6a7c e940699 dd34f22 560e79e e940699 dd34f22 e4c6a7c 9a42d1f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# Multi-stage Dockerfile for BioNexus Hub
# Build the client
FROM node:18-alpine AS client-builder
WORKDIR /app
# Copy client package files
COPY client/package*.json ./
# Install client dependencies
RUN npm install
# Copy client source
COPY client/ ./
# Build client
RUN npm run build
# Production image
FROM node:18-alpine
# Create app directory
WORKDIR /app
# Copy package files for server
COPY server/package*.json ./
# Install server dependencies
RUN npm install --only=production
# Copy server source
COPY server/ ./
# Copy client build to public directory
RUN mkdir -p public
COPY --from=client-builder /app/dist public
# Set environment variables for Hugging Face Spaces
ENV HF_SPACES=true
ENV PORT=8501
ENV NODE_ENV=production
# Expose port 8501 for Hugging Face Spaces
EXPOSE 8501
# Start the Node.js server
CMD ["node", "index.js"] |