# Use Red Hat UBI minimal image FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5-204 # Set working directory WORKDIR /app # Copy application files COPY app/* /app/ # Switch to root user to install necessary packages USER root # Update and install dependencies RUN microdnf update -y && \ rm -rf /var/cache/yum && \ microdnf install nodejs && \ microdnf install python3 && \ microdnf install make && \ microdnf install gcc && \ microdnf install gcc-c++ && \ microdnf install cmake && \ cd /app && \ rm -rf node_modules && \ npm install --unsafe-perm && \ chown -R 1001:0 /app # Switch back to a non-root user for security USER 1001 # Expose the application port EXPOSE 8000 # Define environment variables (optional, you can set them at runtime too) ENV REMOTE_HOST=your.remote.host ENV REMOTE_USERNAME=username ENV REMOTE_PASSWORD=password # Start the Node.js server CMD [ "node", "server.js" ]