One-For-All-Server / Dockerfile
hprasath's picture
Update Dockerfile
1f6fd37 verified
raw
history blame
567 Bytes
# Use a specific version of the node image as a base
FROM node:16-alpine
# Install OpenJDK (Java)
RUN apk add --no-cache 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 Java files
RUN mkdir -p /code/temp && \
chmod 777 /code/temp
# Expose port
EXPOSE 7860
# Set user to non-root
USER node
# Start Node.js application
CMD ["node", "index.js"]