mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-18 07:44:45 +03:00
15137c9e69
Add Docker deployment option for the server with multi-stage build. Changes: - Dockerfile: multi-stage build (golang:1.26-alpine → alpine:3.21, ~23MB) - docker-compose.yml: server service on port 5300/udp with iptables redirect - .env.example: documented environment variables template - .dockerignore: optimized build context - README.md & README-FA.md: Docker deployment guide, port 53 safety checks, and troubleshooting instructions (both EN and FA) - configs: added more Telegram channels and X accounts The container listens on port 5300 to avoid conflict with systemd-resolved. External DNS traffic (port 53) is redirected via iptables PREROUTING. No changes to existing Go source code.
61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
# ============================================================
|
|
# thefeed-server — Docker Compose
|
|
# ============================================================
|
|
#
|
|
# Quick start (public channels, no Telegram login):
|
|
# 1. cp .env.example .env (edit with your domain & key)
|
|
# 2. mkdir -p data && cp configs/channels.txt data/
|
|
# 3. docker compose up -d
|
|
# 4. Set up iptables to redirect external port 53 to 5300:
|
|
# sudo iptables -t nat -I PREROUTING -i eth0 -p udp --dport 53 -j REDIRECT --to-ports 5300
|
|
# sudo iptables -I INPUT -p udp --dport 5300 -j ACCEPT
|
|
# (replace eth0 with your network interface — check with: ip a)
|
|
#
|
|
# With Telegram (one-time login first):
|
|
# 1. cp .env.example .env (uncomment Telegram vars)
|
|
# 2. docker compose run -it --rm server \
|
|
# --login-only --data-dir /data \
|
|
# --domain ${THEFEED_DOMAIN} --key ${THEFEED_KEY} \
|
|
# --api-id ${TELEGRAM_API_ID} --api-hash ${TELEGRAM_API_HASH} \
|
|
# --phone ${TELEGRAM_PHONE}
|
|
# 3. Remove --no-telegram from the command below
|
|
# 4. docker compose up -d
|
|
#
|
|
# Logs: docker compose logs -f
|
|
# Stop: docker compose down
|
|
# ============================================================
|
|
|
|
services:
|
|
server:
|
|
build:
|
|
context: .
|
|
args:
|
|
VERSION: ${VERSION:-docker}
|
|
COMMIT: ${COMMIT:-unknown}
|
|
DATE: ${DATE:-unknown}
|
|
container_name: thefeed-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5300:5300/udp"
|
|
volumes:
|
|
- ./data:/data
|
|
env_file:
|
|
- .env
|
|
command: >-
|
|
--data-dir /data
|
|
--listen :5300
|
|
--domain ${THEFEED_DOMAIN}
|
|
--key ${THEFEED_KEY}
|
|
--no-telegram
|
|
# To enable Telegram mode:
|
|
# 1. Run login-only first (see instructions above)
|
|
# 2. Replace the command above with:
|
|
# command: >-
|
|
# --data-dir /data
|
|
# --listen :5300
|
|
# --domain ${THEFEED_DOMAIN}
|
|
# --key ${THEFEED_KEY}
|
|
# --api-id ${TELEGRAM_API_ID}
|
|
# --api-hash ${TELEGRAM_API_HASH}
|
|
# --phone ${TELEGRAM_PHONE}
|