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:

  1. Clone the repository.

    git clone https://github.com/Bento-Project-SCARS/ProjectSCARS.git
    
  2. Navigate to the repository directory.

    cd ./ProjectSCARS
    
  3. 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
    
  4. 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

  1. Get your database ready. You can use Render's PostgreSQL service and set up Bento by following the database setup documentation
  2. 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

  1. Create a new Render account or log in to your existing account.
  2. Create a new Web Service.
  3. Select the GitHub repository Bento-Project-SCARS/ProjectSCARS.
  4. 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
  1. Add the following environment variables:
Variable Name Value
CENTRAL_SERVER_CONFIG_FILE /etc/secrets/config.json
  1. 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 to false to disable file logging.

  1. Set "Health Check Path" to /api/v1/healthcheck.
  2. Click "Deploy Web Service" to start the deployment.
  3. Wait for the deployment to complete. You can check the logs for any issues.

Deploying the Web Client

  1. Create a new Render account or log in to your existing account.
  2. Create a new Web Service.
  3. Select the GitHub repository Bento-Project-SCARS/ProjectSCARS.
  4. 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
  1. 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
  1. Click "Deploy Web Service" to start the deployment.
  2. Wait for the deployment to complete. You can check the logs for any issues.