Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.19 KB

DEVELOP_BACKEND_DOCKER.md

File metadata and controls

21 lines (16 loc) · 1.19 KB

Docker-compose backend deployment guide

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:

  1. Change directory to the src folder: cd src
  2. Create a file named .env in the current directory (refer to .env.docker_backup): cp docker_env .env
  3. 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
  1. Save .env
  2. set -a
  3. Set .env as the source: source .env
  4. Start the 2 containers: docker-compose up -d
  5. View the exposed TCP HTTP port and UDP COAP port of the HTTP-COAP server: docker container list
  6. Consider using a reverse proxy such as Nginx to route TCP and UDP packets to the server. See Nginx's documentation.