|
| 1 | +# Dokploy Deployment (Railway Config) |
| 2 | + |
| 3 | +This repo now includes a Railway-compatible `railpack.json` per deployable app: |
| 4 | + |
| 5 | +- `apps/api/railpack.json` |
| 6 | +- `apps/dashboard/railpack.json` |
| 7 | +- `apps/discord-bot/railpack.json` |
| 8 | + |
| 9 | +Each config is monorepo-safe and runs install/build/start from the repository root with pnpm filters. |
| 10 | + |
| 11 | +## 1) Create Services In Dokploy |
| 12 | + |
| 13 | +Create one Dokploy service per app from the same repository. |
| 14 | + |
| 15 | +### API service |
| 16 | + |
| 17 | +- Service type: Application |
| 18 | +- Build provider: Railway config (Railpack) |
| 19 | +- Root directory: `apps/api` |
| 20 | +- Config file: `railpack.json` |
| 21 | + |
| 22 | +### Dashboard service |
| 23 | + |
| 24 | +- Service type: Application |
| 25 | +- Build provider: Railway config (Railpack) |
| 26 | +- Root directory: `apps/dashboard` |
| 27 | +- Config file: `railpack.json` |
| 28 | + |
| 29 | +### Discord bot service |
| 30 | + |
| 31 | +- Service type: Application |
| 32 | +- Build provider: Railway config (Railpack) |
| 33 | +- Root directory: `apps/discord-bot` |
| 34 | +- Config file: `railpack.json` |
| 35 | + |
| 36 | +## 2) Environment Variables |
| 37 | + |
| 38 | +Set these variables in Dokploy per service. |
| 39 | + |
| 40 | +### API |
| 41 | + |
| 42 | +Required or strongly recommended: |
| 43 | + |
| 44 | +- `NODE_ENV=prod` |
| 45 | +- `HOST=0.0.0.0` |
| 46 | +- `PORT=5001` (or Dokploy-provided port) |
| 47 | +- `DATABASE_URL=<postgres-connection-string>` |
| 48 | +- `DATABASE_URL_NON_POOLING=<postgres-nonpooling-connection-string>` |
| 49 | +- `REDIS_URL=<redis-connection-string>` |
| 50 | +- `ALLOWED_ORIGINS=<comma-separated-frontend-origins>` |
| 51 | + |
| 52 | +Optional (feature dependent): |
| 53 | + |
| 54 | +- `SECRET` |
| 55 | +- `PRIVATE` |
| 56 | +- `PUBLIC` |
| 57 | +- `GITHUB_APP_NAME` |
| 58 | +- `GITHUB_WEBHOOK_SECRET` |
| 59 | + |
| 60 | +### Dashboard |
| 61 | + |
| 62 | +- `PORT=4173` (optional if Dokploy injects a port) |
| 63 | +- `VITE_PROD_API_URL=<public-api-url>` |
| 64 | +- `VITE_DEV_API_URL=<dev-api-url-if-needed>` |
| 65 | + |
| 66 | +### Discord bot |
| 67 | + |
| 68 | +- `NODE_ENV=prod` |
| 69 | +- `DATABASE_URL=<postgres-connection-string>` |
| 70 | +- `REDIS_URL=<redis-connection-string>` |
| 71 | +- `DISCORD_TOKEN=<bot-token>` |
| 72 | +- Any other bot-specific env variables used in `apps/discord-bot/src/config` |
| 73 | + |
| 74 | +## 3) Notes |
| 75 | + |
| 76 | +- Use pnpm-compatible Node runtime (Node 22+, as required by this repo). |
| 77 | +- Railpack commands invoke pnpm directly through Corepack (`corepack pnpm@10.12.1 ...`) to avoid PATH/shim issues in some builders. |
| 78 | +- The dashboard service runs `vite preview` and binds to `0.0.0.0`. |
| 79 | +- If Dokploy sets `PORT`, the dashboard config uses it. Otherwise it falls back to `4173`. |
| 80 | +- API and bot builds rely on workspace package `@taskcord/database`, which is why install/build commands are executed from monorepo root. |
0 commit comments