Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Latest commit

 

History

History
69 lines (43 loc) · 2.42 KB

File metadata and controls

69 lines (43 loc) · 2.42 KB

Backend

A nodejs server running express to expose a REST api.
Dependent on component storage for, well, data storage.

Docs

For the developer

Official

Tutorials, guides and other googly stuff

Security

  • Backend has no public endpoint in production, it is only available inside the same namespace
  • Storage credentials
    The env var REDIS_PASSWORD must be set both in backend and storage container
    • Development configuration, see below
    • Production configuration, set as secret REDIS_PASSWORD for both backend and storage container in Radix

Development

The ./docker-compose.yaml contains everything we need to run a development environment.
Note that only the backend component will be a development container, the rest will run production builds based on their respective dockerfiles.

Make sure the shared .env file is available in your local repo, see ../README/Storage credentials in shared .env file

Storage credentials in shared .env file

We make use of docker-compose .env file to insert credentials as environment variables in the storage and backend container.

  1. Simply create your own .env file in root of repo
  2. and add variables in key=value format
    REDIS_PASSWORD=<insert-your-password>

Make sure .env is gitignored!

Build and run development environment

docker-compose up --build
docker exec -it backend_development bash

Build and run production image

Read the file dockerfile.backend for configuration details.

docker build -t backend -f dockerfile.backend .
docker run -it --name backend backend