Skip to content

Latest commit

 

History

History
73 lines (50 loc) · 1.71 KB

File metadata and controls

73 lines (50 loc) · 1.71 KB

Deployment Guide

This guide covers a standard production deployment with Bun, Nginx, MySQL, and Redis.

1) Build and run

bun run build
bun run start

The production process runs through server.mjs, which serves Next.js and Socket.IO in one runtime.

2) Required production environment

At minimum:

  • AUTH_URL=https://your-domain
  • ALLOWED_ORIGIN=https://your-domain
  • HOSTNAME=0.0.0.0
  • PORT=3000
  • all required auth/database/redis variables from setup guide

3) Reverse proxy (Nginx)

Use a proxy config that supports WebSocket upgrades. Route both normal HTTP and /api/ws traffic to the app process.

Key points:

  • set proxy_http_version 1.1
  • forward Upgrade and Connection headers for websocket path
  • forward Host and X-Forwarded-* headers
  • terminate TLS at Nginx

4) Process supervision

PM2 example:

npm install -g pm2
pm2 start --interpreter bun server.mjs --name softora-queue --env production
pm2 save
pm2 startup

You can also use systemd or container orchestration if preferred.

5) Database and schema

Before first production start (and after schema changes):

bunx prisma generate
bunx prisma db push

6) FiveM production settings

In fivem/softora-queue/config.lua, ensure:

  • Config.ApiUrl points to public production URL
  • Config.ApiKey matches server record in admin panel
  • Config.QueueUrl points to user-facing queue URL

7) Pre-launch checklist

  • DNS and TLS certificates are active
  • MySQL and Redis are reachable from app host
  • Discord OAuth callback uses production domain
  • proxy supports websocket upgrades
  • API keys are unique per server and stored securely
  • logs are collected and monitored
  • backup strategy exists for MySQL