sanjay7178 commited on
Commit
92779c8
1 Parent(s): ea3bc85

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -18
Dockerfile CHANGED
@@ -1,29 +1,15 @@
1
  # Use Ubuntu as the base image
2
  FROM ubuntu:latest
3
 
4
- # Install socat and openssl
5
  RUN apt-get update && \
6
- apt-get install -y socat openssl && \
7
  apt-get clean
8
 
9
- # Generate self-signed certificate and key
10
- RUN mkdir -p /etc/ssl/certs && \
11
- mkdir -p /etc/ssl/private && \
12
- openssl req -newkey rsa:2048 -nodes -keyout /etc/ssl/private/mykey.pem -x509 -days 365 -out /etc/ssl/certs/mycert.pem -subj "/C=US/ST=State/L=City/O=Org/OU=Unit/CN=localhost"
13
-
14
- # Set appropriate permissions for the certificate and key
15
- RUN chmod 600 /etc/ssl/private/mykey.pem && \
16
- chmod 644 /etc/ssl/certs/mycert.pem
17
-
18
- # Verify file permissions and existence
19
- RUN ls -l /etc/ssl/private/mykey.pem && \
20
- ls -l /etc/ssl/certs/mycert.pem
21
-
22
  # Create the socat proxy script
23
  RUN echo '#!/bin/sh\n\
24
- echo "Starting socat with the following command:"\n\
25
- echo "socat -d -d TCP4-LISTEN:7860,reuseaddr,fork OPENSSL:115.244.41.198:7860,verify=0,cert=/etc/ssl/certs/mycert.pem,key=/etc/ssl/private/mykey.pem"\n\
26
- socat -d -d TCP4-LISTEN:7860,reuseaddr,fork OPENSSL:115.244.41.198:7860,verify=0,cert=/etc/ssl/certs/mycert.pem,key=/etc/ssl/private/mykey.pem' \
27
  > /usr/local/bin/start-proxy.sh && chmod +x /usr/local/bin/start-proxy.sh
28
 
29
  # Expose the port
 
1
  # Use Ubuntu as the base image
2
  FROM ubuntu:latest
3
 
4
+ # Install socat
5
  RUN apt-get update && \
6
+ apt-get install -y socat && \
7
  apt-get clean
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  # Create the socat proxy script
10
  RUN echo '#!/bin/sh\n\
11
+ socat -d -d TCP4-LISTEN:7860,reuseaddr,fork \
12
+ OPENSSL:115.244.41.198:7860,verify=0' \
 
13
  > /usr/local/bin/start-proxy.sh && chmod +x /usr/local/bin/start-proxy.sh
14
 
15
  # Expose the port