🌥️
Patient Cloud
  • README
  • Auth
    • Google Identity
    • Identity Providers
    • Nest Auth Service
  • Microservices
    • NestJS Overview
  • Security
    • API Security
    • Trails
  • Client App Security
  • Development
    • Sentry logging
  • Build
    • Local Build
    • Using Cloud Build
  • Social login
    • Social login
  • NHS
    • NHS Login
  • GraphQL
    • Playground
  • Testing
    • Unit Tests
    • Integration Tests
    • End to End tests
Powered by GitBook
On this page
  • Running using Docker
  • Running using Node.js
  • Configuration

Was this helpful?

  1. Build

Local Build

PreviousSentry loggingNextUsing Cloud Build

Last updated 4 years ago

Was this helpful?

Running using Docker

Docker is the fastest way to run Patient Cloud API. The image located on Docker Hub .

With you can easily configure, install, and upgrade your Docker-based Patient Cloud installation:

Example docker-compose.yml with MariaDB (check chapter for configuration options):

version: '3'
services:
  patientcloud:
    image: tinymedicalapps/patientcloud
    volumes:
      - google.credentials.json:/config/google.credentials.json
    environment:
      - DB_URL=mysql://patientcloud:patientcloud@db:3306/patientcloud
      - NODE_PORT=80
      - NODE_ENV=development
      - JWT_SECRET=your_secret_key_add_your_own
      - FRONTEND_URL=http://localhost:3000
      - NHS_OPEN_ID_ENDPOINT=https://auth.sandpit.signin.nhs.uk
      - NHS_OPEN_ID_CLIENT_ID=digital-health-passport
      - NHS_OPEN_ID_CLIENT_PASSWORD=dummy
      - NHS_OPEN_ID_CLIENT_SCOPE=openid profile
      - NHS_OPEN_ID_CLIENT_KEY=private_key.pem
      - NHS_OPEN_ID_CLIENT_REDIRECT_URI=http://localhost/auth/nhs-callback
      - SESSION_SECRET=your_session_secret_key_add_your_own
      - GOOGLE_APPLICATION_CREDENTIALS=/config/google.credentials.json
  db:
    image: mariadb:10.5
    volumes:
      - mysqldata:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=patientcloud
      - MYSQL_USER=patientcloud
      - MYSQL_PASSWORD=patientcloud

volumes:
  mysqldata:
    driver: 'local'

Make sure you are in the same directory as docker-compose.yml and start Patient Cloud:

docker-compose up -d

Running using Node.js

  1. Clone Patient Cloud repository:

    git clone https://github.com/TinyMedicalApps/PatientCloud.git .
  2. Change directory:

    cd PatientCloud
  3. Install dependencies:

    npm install
  4. Run Patient Cloud

    npm start

Configuration

Patient Cloud uses environment variables for configuration. Here is a list of all variables:

Variable

Description

NODE_ENV

Set to development or production

DB_URL

Database connection URL. Example: mysql://login:password@host:3306/dbname

EMAIL_TRANSPORT_URL

SMTP connection URL for sending mails. Example: smtps://login:password@email-smtp.eu-central-1.amazonaws.com

EMAIL_FROM

From email. Example: noreply@patientcloud.ai

NODE_PORT

Running port: 80

JWT_SECRET

JSON Web Token secret key string.

FRONTEND_URL

Front end URL. Used for user registration activation, password recovery and oAuth redirect.

SENTRY_DSN

NHS_OPEN_ID_ENDPOINT

NHS OpenID endpoint. https://auth.sandpit.signin.nhs.uk for sandbox.

NHS_OPEN_ID_CLIENT_ID

NHS OpenID clientId digital-health-passport

NHS_OPEN_ID_CLIENT_PASSWORD

NHS OpenID password dummy

NHS_OPEN_ID_CLIENT_SCOPE

NHS OpenID scope openid profile

NHS_OPEN_ID_CLIENT_KEY

NHS OpenID private key private_key.pem The key located at /common/keys directory

NHS_OPEN_ID_CLIENT_REDIRECT_URI

NHS OpenID redirect URL http://localhost/auth/nhs-callback Backend NHS callback process endpoint.

GOOGLE_APPLICATION_CREDENTIALS

Full path on local file system to Google application credentials, e.g.: /config/google.credentials.json

SENTRY_DSN

TRAILS_URL

Configure Patient Cloud environment variables and database. Check chapter.

connection URL

Sentry.io connection URL e.g.

Trails audit connection URL e.g.:

https://hub.docker.com/r/tinymedicalapps/patientcloud
Docker Compose
Patient Cloud Configuration
Patient Cloud Configuration
https://sentry.io
https://xxxxxxxxxxxxx@o123123.ingest.sentry.io/1231233
https://1.1.1.1:8080