This project allows the user to launch the full stack for the ngenCERF web application using Docker Compose. This includes:
- The application's frontend UI application server
- The backend services' application server
- A database, based on PostgreSQL
To build and run the ngenCERF stack, you will need the following software installed and running on your system:
- Docker Engine and Docker Compose
You will also need the following repos cloned:
The directory structure should look like this:
$ tree -L 1
.
├── data
│ ├── db
│ ├── ngen-cal-data
| └── .ngencerf-init
├── nextgen_ui
├── ngencerf-docker
└── ngencerf-server
You will also need files with the following credentials:
- AWS S3 credentials: saved to ngencerf-server/.aws_credentials
- NGWPC gitlab Personal Access Token (PAT): saved to ~/.gitlab_token.
This will also create directories to persist data for:
- the PostgreSQL database
- initialization data for the ngencerf-server application.
- data from the ngen-cal tool
To run the ngenCERF applicaton , execute the following command:
docker compose up
This will give you an instance of:
- ngenCERF web application, running on your system at the address http://localhost:3000.
- ngenCERF services, running on your system at the address http://localhost:8000
- PostgreSQL, running on your system at localhost:5432
To shut all 3 applications down press Ctrl+C or run the command:
docker compose down
If for some reason you don't see code updates being pulled into your ngencerf-server container run the following command to force a rebuild of the container:
docker compose up --build
After the rebuild is complete it will restart all the necessary services.
By default, the first time this container is run it will perform a load of all the necessary static data into the database. When complete it will write the file ../data/.ngencerf-init/.load_static. You can delete this file to force the data to be reloaded the next time your start the application.
If there is a need to connect to a container to issue commands from a terminal, perform the following steps:
- Get a list of the running containers by executing the following command:
docker container ls
- Attach a terminal to that container:
docker exec -it <container_id> bash
- Execute any needed commands from that terminal.
- Issue the following command to disconnect:
exit
- Create separate configurations/environments for development and production