@@ -17,8 +17,32 @@ The database image is built, using a Gitlab Pipeline, and stored [here](https://
- TimescaleDB: There are multiple internal schemas generated by the TimescaleDB plugin. It’s best to leave these alone…
- PostgisFTW: This is the default schema that exposes functions and collections to the web, via a rest API managed by Pg_Featureserv.
The base schema is defined by a set of scripts in the `./build/db_init_data` and can be extended by extra scripts in the `./build/db_init_scripts_prod` directory. Postgres runs these scripts in alphabetical order so any additional scripts can be added and times by changing their filename to put them in the correct order during DB build. This includes several files types like .sql and .sh.
*NOTE*: The ordering of the schema files can be used for versioning of the database. It is recommended to *not* change the files already in the repository but instead to insert new files that change the schema, that way they can be applied to already running instances of the DB.
# Git Branches
There are two git branches that are specified in the git pipeline: the default `main` branch and a `staging` branch. The intention here is that the default branch is used for production deployments with the associated config and docker files:
## Production
| File | Purpose |
| :--- | :----: |
| docker-compose.yaml | Compose Deployment File |
| config/main.env | Example config file for deployment |
| dockerfile | Dockerfile used to build production docker image |
| openais/processing/integrated-database:latest | Production docker image built and hosted on Gitlab|
## Staging/Development
| File | Purpose |
| :--- | :----: |
| docker-compose-staging.yaml | Compose Deployment File for dev work |
| config/stagin.env | Example config file for dev deployment |
| dockerfile-staging | Dockerfile used to build dev docker image with limited schema |
| openais/processing/integrated-database:staging | Dev docker image built and hosted on Gitlab|
# Deployment
The deployment of the AIS database, along with tools to support it, is described [here](https://gitlab.com/openais/deployment/data-services) or [here](https://open-ais.org/quick-start/3/). It is not expected to deploy from this repository for production purposes but it might be useful for local development
The deployment of the AIS database, along with tools to support it, is described [here](https://gitlab.com/openais/deployment/data-services) or [here](https://open-ais.org/quick-start/3/). It is not expected to deploy from this repository for production purposes but it might be useful for local development.
## Running this locally without all the extra bits