feat(gateway): add scoped proxy egress deployment

This commit is contained in:
wmq
2026-08-01 19:53:29 +08:00
parent 06112602ec
commit cf25d71fcf
14 changed files with 114 additions and 4 deletions
+6
View File
@@ -1,5 +1,8 @@
FROM node:20-bookworm-slim AS builder
ARG DEBIAN_MIRROR=https://deb.debian.org/debian
ARG DEBIAN_SECURITY_MIRROR=https://deb.debian.org/debian-security
RUN sed -i "s|http://deb.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g; s|http://deb.debian.org/debian|${DEBIAN_MIRROR}|g" /etc/apt/sources.list.d/debian.sources
RUN apt-get update \
&& apt-get install -y --no-install-recommends g++ make python3 \
&& rm -rf /var/lib/apt/lists/*
@@ -22,6 +25,9 @@ RUN npm prune --omit=dev
FROM node:20-bookworm-slim
ARG DEBIAN_MIRROR=https://deb.debian.org/debian
ARG DEBIAN_SECURITY_MIRROR=https://deb.debian.org/debian-security
RUN sed -i "s|http://deb.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g; s|http://deb.debian.org/debian|${DEBIAN_MIRROR}|g" /etc/apt/sources.list.d/debian.sources
RUN apt-get update \
&& apt-get install -y --no-install-recommends tini ca-certificates \
&& rm -rf /var/lib/apt/lists/*
+10 -1
View File
@@ -30,9 +30,12 @@ services:
build:
context: ..
dockerfile: docker/Dockerfile
args:
DEBIAN_MIRROR: ${DEBIAN_MIRROR:-https://deb.debian.org/debian}
DEBIAN_SECURITY_MIRROR: ${DEBIAN_SECURITY_MIRROR:-https://deb.debian.org/debian-security}
container_name: tgw-app
ports:
- '3000:3000'
- '127.0.0.1:3010:3000'
env_file:
- ../.env
environment:
@@ -52,6 +55,12 @@ services:
TDLIB_PATH: /app/node_modules/@prebuilt-tdlib/linux-x64-glibc/libtdjson.so
TG_API_ID: ${TG_API_ID}
TG_API_HASH: ${TG_API_HASH}
TG_DEFAULT_PROXY_TYPE: ${TG_DEFAULT_PROXY_TYPE:-}
TG_DEFAULT_PROXY_HOST: ${TG_DEFAULT_PROXY_HOST:-}
TG_DEFAULT_PROXY_PORT: ${TG_DEFAULT_PROXY_PORT:-}
TG_DEFAULT_PROXY_USERNAME: ${TG_DEFAULT_PROXY_USERNAME:-}
TG_DEFAULT_PROXY_PASSWORD: ${TG_DEFAULT_PROXY_PASSWORD:-}
TG_DEFAULT_PROXY_SECRET: ${TG_DEFAULT_PROXY_SECRET:-}
depends_on:
postgres:
condition: service_healthy
@@ -0,0 +1,8 @@
-- Telegram User Gateway - Database Initialization
-- This script runs on first PostgreSQL startup
-- Enable UUID extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Create indexes will be handled by TypeORM synchronize in dev
-- or by migrations in production