debugService2 / Dockerfile
deepak191z's picture
Update Dockerfile
4796e39 verified
raw
history blame
684 Bytes
FROM node:18-alpine
# Install OpenJDK 17 (for apk-mitm and other Java-based tools)
RUN apk add --no-cache openjdk17
# Set working directory
WORKDIR /app
# Copy package files first for better caching
COPY package*.json ./
# Install global dependencies and project dependencies in one step
RUN npm install -g apk-mitm && npm install --production
# Copy the rest of the application files with correct ownership
COPY --chown=node:node . .
# Create uploads directory with correct permissions
RUN mkdir -p /app/uploads
# Switch to non-root user
USER node
# Set environment variable for port
ENV PORT=7860
# Expose the port
EXPOSE 7860
# Start the application
CMD ["npm", "start"]