clone3 commited on
Commit
fabf2bd
·
verified ·
1 Parent(s): cf09021

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -24
Dockerfile CHANGED
@@ -1,26 +1,26 @@
1
- # Use a base image with SSH support, like Ubuntu
2
- FROM ubuntu:22.04
3
-
4
- # Update package list and install necessary packages
5
- RUN apt-get update && apt-get install -y \
6
- openssh-server \
7
- sudo \
8
- curl \
9
- vim \
10
- net-tools \
11
- && mkdir /var/run/sshd
12
-
13
- # Create a new user and set a password (modify username and password as needed)
14
- RUN useradd -rm -d /home/user -s /bin/bash -g root -G sudo -u 1000 user && \
15
- echo 'user:user' | chpasswd && \
16
- echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
17
-
18
- # Allow root login and password authentication
19
- RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
20
- RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
21
-
22
- # Expose SSH port
23
  EXPOSE 7860
24
 
25
- # Start the SSH service when the container starts
26
- CMD ["/usr/sbin/sshd", "-D"]
 
 
 
 
 
 
 
 
 
 
1
+ # Base image: Node.js version 18 (which supports the required Node.js version 7.6.0+)
2
+ FROM node:18
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Clone the Node-Web-Console repository
8
+ RUN git clone https://github.com/ChrisCindy/node-web-console.git .
9
+
10
+ # Install dependencies
11
+ RUN npm install
12
+
13
+ # Expose the port the app will run on (3000 by default)
 
 
 
 
 
 
 
 
 
14
  EXPOSE 7860
15
 
16
+ # Copy configuration file and set user/password
17
+ COPY config/index.js /app/config/index.js
18
+
19
+ # Set environment variables (if needed)
20
+ ENV NODE_ENV=production
21
+
22
+ # Run the production build
23
+ RUN npm run client:build
24
+
25
+ # Command to run the server using pm2
26
+ CMD ["npm", "run", "prod"]