elgammalx/tweb

By elgammalx

Updated 6 months ago

Production-ready Telegram Web K Docker image based on Nginx.

Image
Message Queues
Web Servers
1

106

Telegram Web K - Production Ready Docker Image

Overview

Production-ready build of Telegram Web K, a web-based Telegram client, optimized for Nginx.

Features
  • Base Image: Uses Node.js 18 for building the application.
  • Nginx: Utilizes the stable-alpine version of Nginx for serving the application.
  • Optimized for Production: Includes only the necessary dependencies for running the application in a production environment.
Usage

Building the Image: Dockerised source code Moustafa-Elgammal/tweb forked from morethanwords/tweb the web source code for web.telegram.org

To build the Docker image, use the following command:

docker build -f ./.docker/Dockerfile_production -t your_dockerhub_username/tweb:latest .

This will start the container and expose the application on port 80.

Dockerfile Details

The Dockerfile for the production image performs the following steps:

  1. Base Image: Starts with node:18 as the base image.
  2. Set Working Directory: Sets the working directory to /app.
  3. Copy Source Code: Copies the source code into the container.
  4. Install Dependencies: Installs pnpm globally and then uses it to install both development and production dependencies.
  5. Build the Application: Runs the build script to generate the production files.
  6. Nginx Setup: Switches to the nginx:stable-alpine3.19-slim image and copies the build files to the Nginx directory.
Example Docker Compose

For convenience, you can use the following docker-compose.yml to set up the production environment:

version: '3.8'
services:
  telegram-web-k:
    image: elgammalx/tweb
    ports:
      - "80:80"

Docker Pull Command

docker pull elgammalx/tweb