Spaces:
Sleeping
Sleeping
File size: 668 Bytes
de28d21 0188a6a 45b9bf0 23c86b4 106c54e de28d21 0188a6a 45b9bf0 f830391 04a901a 0188a6a 45b9bf0 0188a6a f2e4670 447b213 106c54e 36f24f3 0188a6a 09c3faf |
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 |
# Use a specific version of the node image as a base
FROM node:16-alpine
# Install necessary dependencies including JDK, Python, pip, and g++
RUN apk add --no-cache openjdk11 python3 py3-pip g++
# Set working directory
WORKDIR /code
# Copy package.json and package-lock.json and install dependencies
COPY package*.json ./
RUN npm install --production
# Copy the rest of the application files
COPY . .
# Create a directory for temporary files
RUN mkdir -p /code/temp
# Set permissions for the /code/temp directory
RUN chown -R node:node /code/temp
# Expose port
EXPOSE 7860
# Set user to non-root
USER node
# Start Node.js application
CMD ["node", "index.js"]
|