sanjay7178 commited on
Commit
4bb7c71
·
verified ·
1 Parent(s): 8fb9722

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -18,13 +18,10 @@ RUN set -x \
18
  && npm cache clear --force \
19
  && chown -R rocketchat:rocketchat /app
20
 
21
- # # Install iptables
22
- # RUN apt-get update && \
23
- # apt-get install -y iptables && \
24
- # rm -rf /var/lib/apt/lists/*
25
-
26
- # Set up iptables rule to redirect port 7860 to 3000
27
- RUN iptables -t nat -A PREROUTING -p tcp --dport 7860 -j REDIRECT --to-port 3000
28
 
29
  USER rocketchat
30
 
@@ -41,7 +38,9 @@ ENV DEPLOY_METHOD=docker \
41
  ROOT_URL=http://localhost:3000 \
42
  Accounts_AvatarStorePath=/app/uploads
43
 
44
- # Expose the external port 7860
45
  EXPOSE 7860
46
 
47
- CMD ["node", "main.js"]
 
 
 
18
  && npm cache clear --force \
19
  && chown -R rocketchat:rocketchat /app
20
 
21
+ # Install socat for port forwarding
22
+ RUN apt-get update && \
23
+ apt-get install -y socat && \
24
+ rm -rf /var/lib/apt/lists/*
 
 
 
25
 
26
  USER rocketchat
27
 
 
38
  ROOT_URL=http://localhost:3000 \
39
  Accounts_AvatarStorePath=/app/uploads
40
 
41
+ # Expose port 7860 externally
42
  EXPOSE 7860
43
 
44
+ # Run socat to forward port 7860 to 3000 and start Rocket.Chat
45
+ CMD socat TCP-LISTEN:7860,reuseaddr,fork TCP:localhost:3000 & \
46
+ node main.js