File size: 976 Bytes
2be2655
 
 
 
9178778
13a9abd
2be2655
 
 
 
 
 
 
 
 
 
 
9178778
13a9abd
 
 
6725c73
 
 
cac94fb
9178778
 
cac94fb
9178778
 
 
cac94fb
9178778
 
cac94fb
13a9abd
9178778
cac94fb
 
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
FROM ubuntu:20.04

# Set non-interactive mode for installation
ENV DEBIAN_FRONTEND=noninteractive

# Update system packages and install necessary tools
RUN apt-get update -y && apt-get install -y \
    curl \
    wget \
    tmate \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install Node.js 18 from NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

# Fix DNS issue by setting Google's DNS resolver
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf

# Ensure the user is set to root (by default, Docker runs as root)
USER root

# Set the working directory
WORKDIR /app

# Copy package.json and install dependencies
COPY package.json .
RUN npm install

# Copy the rest of the application files
COPY . .

# Expose necessary ports
EXPOSE 3000 4000 5000 8080 888 80 443 22

# Run both Node.js server and tmate in parallel
CMD ["bash", "-c", "node server.js & tmate -F"]