The back-end server can be deployed via docker-compose
as two Docker containers, dynalite_backend
and dynalite_psql
. dynalite_backend
will contain the NodeJS HTTP-COAP server app. dynalite_psql
will contain the PostgreSQL database.
This guide assumes you have already installed NodeJS, PostgreSQL and performed npm install
. If you have not, please see local backend server deployment guide.
To deploy:
- Change directory to the src folder:
cd src
- Create a file named .env in the current directory (refer to .env.docker_backup):
cp docker_env .env
- Open .env and change the environment variable fields accordingly:
vim .env
Note:
- 5432 is the default port for PostgreSQL.
- DATABASE_URL is used by Bob
- Save .env
set -a
- Set .env as the source:
source .env
- Start the 2 containers:
docker-compose up -d
- View the exposed TCP HTTP port and UDP COAP port of the HTTP-COAP server:
docker container list
- Consider using a reverse proxy such as Nginx to route TCP and UDP packets to the server. See Nginx's documentation.