deployment-railway
Deploy Python Flask applications to Railway.app with environment configuration and webhook setup
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
When to use this skill
Deploy Flask LINE bots to Railway.app, configure environment variables, set up webhooks, and monitor deployments.
How to use it
Required Files
Procfile:
web: python main.py
requirements.txt:
Flask==3.0.0
line-bot-sdk==3.5.0
APScheduler==3.10.4
firebase-admin==6.2.0
main.py entry point:
if __name__ == "__main__":
port = int(os.getenv("PORT", 5000))
app.run(host="0.0.0.0", port=port)
Environment Variables
Set in Railway dashboard:
-
LINE_CHANNEL_ACCESS_TOKEN- LINE Bot token -
LINE_CHANNEL_SECRET- Channel secret -
FIREBASE_CONFIG_JSON- Complete Firebase JSON
Deployment Steps
- Connect GitHub repo to Railway
- Set environment variables
- Get generated domain URL
- Configure LINE webhook:
https://your-app.up.railway.app/callback
Monitoring
Add health check:
@app.route("/", methods=['GET'])
def health_check():
return "Bot is running!", 200
View logs in Railway dashboard → Deployments → View Logs
Common Issues
-
Crashed: Check
ProcfileandPORTusage -
Webhook 400: Verify
LINE_CHANNEL_SECRET - Firebase failed: Check JSON format in env var
- No scheduled jobs: Upgrade to Hobby plan ($5/mo)
Links
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!