View on GitHub

Passport Online

Passport enterprise server

Atomic Backend Stack

The backend stack launches the database and apps necessary to support a full atomic instance.

The atomic stack makes a few assumptions:

  1. You are running Docker v20.10+.
  2. You are using ngrok to terminate SSL/TSL to your stack to the nginx container port 8080.
  3. The environment variable ATOMIC_API_HOST is set to the hostname for your ngrok config.

You can export the var like this every time, or put it in your ~/.bash_profile or similar file.

export ATOMIC_API_HOST=atomic.rob.modelrocket.io 
  1. The environment variable ATOMIC_INTERNAL_HOST is set to the internal host IP address (not the docker IP, but the interface IP the atomic daemon is reachable on).

    For Windows/WSL2 this can be set in your ~/.bash_profile with something like this:

    export ATOMIC_INTERNAL_HOST=$(ifconfig eth0 | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2)

Docker Networking

Docker networking has some caveats. If you are using WSL2 you likely need to setup the “bip” address:

https://www.beyondjava.net/docker-wsl-network

Database

Atomic uses MySQL for the primary database and redis for temporary object caching. This docker-compose script will start the mysql server and initialize the databases. A redis server is optional and only necessary in production and will NOT be assumed with this stack.

This should be run from the workspace root and will start a mysql server ready for backend testing.

Chrome Headless

Atomic uses a headless version of chrome to capture still images from various social media entities for the purpose of reducing email body complexity.

Atomic needs to know the proper location for your headless instance, via an envvar, if you use this deployment the default is:

CHROME_HEADLESS: http://localhost:9222

For MacOS, localhost does not work with docker, you will need to use your LAN IP address.

Atomic Apps

This backend will launch the edge versions of the atomic-member and atomic-admin containers by default, in order to connect the apps to an API server, the var ATOMIC_API_HOST must be set.

Nginx

This deployment will run nginx on port 8080 and reverse proxy /admin and /member to the respective apps. It will also proxy api traffic to the locally running server.

Running the Stack

The following command, assuming the previous setup has been completed will launch the stack locally.

> docker-compose -f ./deployments/backend/docker-compose.yml up

Updating the Stack

You should use docker-compose to update the stack periodically with:

>  docker-compose -f ./deployments/backend/docker-compose.yml pull