This repository containes required software to run the backend for the TFM project.
Terrestrial Forest Monitor (TFM) Frontend
https://docs.docker.com/desktop/install/ubuntu/
and
!! To clone the repo AND submodules use the --recursive
flag !!
git clone https://github.com/Thuenen-Forest-Ecosystems/TFM-postgres-docker.git
For employees of the Thünen Institute:
git clone --recursive https://github.com/Thuenen-Forest-Ecosystems/TFM-postgres-docker.git
Copy the _.env
file to .env
and change the credentials for production.
docker compose up
To run docker in background mode add -d
Potgrest http://localhost:3000/
Swagger http://localhost:4080/
PgAdmin http://localhost:5050/pgadmin/
docker compose down --volumes
docker compose --env-file ./_.env up
npm test
Add a connection to postGres by register a new Server. Add Host name (PGADMIN_HOST_NAME
), username (POSTGRES_USER
) and password (POSTGRES_PASSWORD
) defined in your .env
file.
Create "New Connection..." to your PostgreSQL server. Add Host name (PGADMIN_HOST_NAME
), username (POSTGRES_USER
) and password (POSTGRES_PASSWORD
) defined in your .env
file.
Fetch and merge (with submodules)
git pull --recurse-submodules
Push changes (with submodules)
git commit -am "commit message"
git push --recurse-submodules
Add a webhook to your repository to automatically build and deploy the docker container on push to main
branch.
npm install
npm install pm2 -g
npm run start
This runs webhook/hook.js
in background on http://localhost:4000/webhook
and starts docker compose.
Next time you push to main, the webhook will be triggered and the docker container will be updated and restart automatically.
You can use https://smee.io/ to create a webhook proxy to your local machine. Full tutorial
To create a new release, create a new tag and push it to the repository.
git tag -a v0.0.1 -m "Initial Release"
git push origin v0.0.1
If "The CSRF session token is missing." error occures
Close pgadmin session in browser tab and retry.