Initial commit: SMS Forwarder project with Docker support

This commit is contained in:
zack
2025-07-17 19:30:35 +08:00
commit 152e136673
29 changed files with 3583 additions and 0 deletions

54
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,54 @@
version: '3.8'
services:
sms-forwarder:
build: .
container_name: sms-forwarder
ports:
- "12152:12152"
volumes:
- ./config.yaml:/app/config.yaml:ro
- sms_logs:/app/logs
- sms_data:/app/data
environment:
- CONFIG_PATH=/app/config.yaml
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:12152/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.1'
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Nginx 反向代理(可选,用于 HTTPS
nginx:
image: nginx:alpine
container_name: sms-forwarder-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- sms-forwarder
restart: unless-stopped
profiles:
- nginx
volumes:
sms_logs:
sms_data: