Spaces:
Sleeping
Sleeping
Overview | |
This repo now contains a `run.py` that mounts `app2.py` routes under the `/bot` prefix and a `Dockerfile` to run the single combined server. | |
Build image (PowerShell): | |
```powershell | |
# From the project folder (where Dockerfile is located) | |
docker build -t farm-portal:latest . | |
``` | |
Run container (PowerShell): | |
```powershell | |
# Map container port 5000 to host 5000 and set environment vars if needed | |
docker run -p 5000:5000 --env GOOGLE_API_KEY="your_key_here" --env GEMINI_API_KEY="your_key_here" --env BOT_TOKEN="your_telegram_bot_token" -d --name farm-portal farm-portal:latest | |
``` | |
How to access | |
- Main portal (original `app.py`) β http://localhost:5000/ | |
- Admin/bot UI (original `app2.py`) β http://localhost:5000/bot/ | |
Notes and caveats | |
- app2 templates may contain absolute links like `/download` or `/scheduled`. When served under `/bot`, those links must be updated to include the `/bot` prefix or use `url_for` in templates. If you see broken links, update `app2.py` templates or the generated HTML to point to `/bot/...`. | |
- The code contains placeholder API keys and tokens. Replace them with environment variables before deploying. | |
- For local testing you can skip setting AI/TG env vars but some AI/Telegram features will be disabled or warn at startup. | |