1 ‐ Deployment - Bento-Project-SCARS/ProjectSCARS GitHub Wiki
Deployment
Deployment via Containers
Bento provides a compose.yml
file for Docker or Podman.
To deploy the system in production mode, follow the steps below:
-
Clone the repository.
git clone https://github.com/Bento-Project-SCARS/ProjectSCARS.git
-
Navigate to the repository directory.
cd ./ProjectSCARS
-
Create a configuration file and a
.env
file for production use and edit it with the proper values.cp ./CentralServer/.config.example.json ./CentralServer/config.prod.json cp ./WebClient/.env.prod.example ./WebClient/.env.prod notepad ./CentralServer/config.prod.json # Or open and edit it with your preferred text editor notepad ./WebClient/.env.prod
-
Build the images and deploy the stack.
# The commands below will build the images and then run the compose stack. podman compose up -d --build # If you are using Podman docker compose up -d --build # If you are using Docker
Exposing the servers through Cloudflare Tunnels
You will have to get your own Cloudflare Tunnel Connector Token. Follow the steps in Cloudflared-web's documentation.
The Docker Compose file of the sytem already includes the cloudflared
service. If
the deployment is successful, you can now access the dashboard in localhost:14333
and set the routes of your web client and central server to the following:
Component | IP |
---|---|
Central Server | centralserver:8081 |
Web Client | webclient:8080 |
Deployment via Render
Bento can also be deployed on Render. Follow these steps:
Prerequisites
- Get your database ready. You can use Render's PostgreSQL service and set up Bento by following the database setup documentation
- Get your object store ready. You can use Cloudflare R2 and set up Bento by following the object store setup documentation.
Deploying the Central Server
- Create a new Render account or log in to your existing account.
- Create a new Web Service.
- Select the GitHub repository
Bento-Project-SCARS/ProjectSCARS
. - Match the following configuration settings:
Setting | Value |
---|---|
Name | ProjectSCARS-centralserver |
Language | Python 3 |
Branch | stable |
Root Directory | CentralServer |
Build Command | uv sync |
Start Command | uv run uvicorn centralserver:app --host 0.0.0.0 --port $PORT |
- Add the following environment variables:
Variable Name | Value |
---|---|
CENTRAL_SERVER_CONFIG_FILE |
/etc/secrets/config.json |
- Expand "Advanced" and add a secret file with the name
config.json
and put the content of your configuration file as its value.
[!NOTE] In your configuration file, set
logging.file_logging_enabled
tofalse
to disable file logging.
- Set "Health Check Path" to
/api/v1/healthcheck
. - Click "Deploy Web Service" to start the deployment.
- Wait for the deployment to complete. You can check the logs for any issues.
Deploying the Web Client
- Create a new Render account or log in to your existing account.
- Create a new Web Service.
- Select the GitHub repository
Bento-Project-SCARS/ProjectSCARS
. - Match the following configuration settings:
Setting | Value |
---|---|
Name | ProjectSCARS |
Language | Node |
Branch | stable |
Root Directory | WebClient |
Build Command | bun install && bun run build |
Start Command | bun run start |
- Add the following environment variables:
Variable Name | Value |
---|---|
NODE_ENV |
production |
LOG_LEVEL |
info |
ENABLE_REACT_SCAN |
false |
NEXT_PUBLIC_CENTRAL_SERVER_ENDPOINT |
The URL of your Central Server + /api endpoint, e.g., https://projectscars-centralserver.onrender.com/api |
PORT |
8080 |
- Click "Deploy Web Service" to start the deployment.
- Wait for the deployment to complete. You can check the logs for any issues.