Files
bracket/docs/content/deployment/systemd.mdx
Erik Vroon 583eb4e963 Migrate Next.js to Vite (#1397)
Vite is much simpler to use than Next.js and we don't need any of the
features Next has that Vite doesn't have.

Benefits of moving to Vite are:
- Much better performance in dev and prod environments
- Much better build times
- Actual support for static exports, no vendor lock-in of having to use
Vercel
- Support for runtime environment variables/loading config from `.env`
files
- No annoying backwards-incompatible changes on major releases of Next
- Better i18n support without having to define getServerSideProps on
every page
- Better bundle optimization
- No opt-out Vercel telemetry 

Also replaces yarn by pnpm and upgrades mantine to 8.3
2025-11-12 11:18:06 +01:00

63 lines
1.2 KiB
Plaintext

---
title: Systemd
---
# Systemd
This section describes how to deploy Bracket (frontend and backend) as a Systemd service on Linux.
This assumes:
- You have installed `yarn` and `pipenv`.
- You have a PostgreSQL cluster running.
- You have cloned Bracket in `/var/lib/bracket`.
- You have created a new user called Bracket with the permissions to read
and write in `/var/lib/bracket`.
Now, You can run the application using `systemd.service` files.
Below is a simple example of the service files for the backend and frontend:
## Backend
```systemd
[Unit]
Description=Bracket backend
After=syslog.target
After=network.target
[Service]
Type=simple
User=bracket
WorkingDirectory=/var/lib/bracket/backend
ExecStart=pipenv run gunicorn -k uvicorn.workers.UvicornWorker bracket.app:app --bind localhost:8400 --workers 1
Environment=ENVIRONMENT=PRODUCTION
TimeoutSec=15
Restart=always
RestartSec=2s
[Install]
WantedBy=multi-user.target
```
## Frontend
```systemd
[Unit]
Description=Bracket frontend
After=syslog.target
After=network.target
[Service]
Type=simple
User=bracket
WorkingDirectory=/var/lib/bracket/frontend
ExecStart=/usr/local/bin/pnpm start
Environment=NODE_ENV=production
TimeoutSec=15
Restart=always
RestartSec=2s
[Install]
WantedBy=multi-user.target
```