File size: 949 Bytes
efcf453
 
5046b21
efcf453
 
5046b21
efcf453
 
5046b21
efcf453
 
5046b21
efcf453
 
 
 
 
 
 
 
 
 
 
 
 
5046b21
efcf453
 
5046b21
efcf453
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
# 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" ]