Skip to content

Docker Server Setup



  1. Make sure you have latest Node 18 installed.

  2. Copy .env.example to .env.

  3. run dependant services (MongoDB, Minio, Redis) via

    Terminal window
    docker-compose -f docker-compose.yml -f docker-compose.development.yml up
  4. Terminal window
    npm install
  5. Terminal window
    npm run migrate-mongo-up
  6. Terminal window
    npm run start
  7. Now the server will be listening for incoming connections at ws://localhost:9001

Deploying the SAMA application can be done easily with Docker, whether you want a complete setup with all dependencies or a local environment with the main applications. Below are the steps to follow:

This approach builds and runs the entire SAMA application, including all dependencies, in a single command. It is ideal for setting up the full environment quickly.

To deploy using this method, run:

Terminal window
docker-compose -f docker-compose-full.yml up --build

To run the dependency services along with the main SAMA applications (sama-client, sama-server, and sama-push-daemon), use:

Terminal window
docker-compose up --build
Terminal window
$env:MINIO*ENDPOINT = (Get-NetIPAddress | Where-Object { $*.AddressFamily -eq 'IPv4' -and $\_.IPAddress -match '^192\.168\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.' } | Select-Object -ExpandProperty IPAddress)[1]; $env:MINIO_PORT = 9010;

Now you can access apps at the following addresses:

Run migrations:

Terminal window
docker-compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run migrate-mongo-up"

Run e2e tests:

Terminal window
docker-compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run test"