One-For-All-Server / Dockerfile
hprasath's picture
Update Dockerfile
eae4632 verified
raw
history blame contribute delete
544 Bytes
FROM node:16-alpine
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"]