Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Add example systemd unit for postgres (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuommaki authored Jan 26, 2024
1 parent 2545679 commit 47bac18
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,36 @@ For persistent effect, create a systemd unit for this.

Gevulot node uses Postgres database for its operation. It has been tested to work with Postgres releases 15 and 16.

### Example systemd unit

Below is an example systemd unit that can be used as a template to run containerized postgres:

**/etc/containers/systemd/gevulot-postgres.container**
```
[Install]
WantedBy=default.target
[Container]
ContainerName=gevulot-postgres
Image=docker.io/library/postgres:16-alpine
Environment=POSTGRES_USER=<username>
Environment=POSTGRES_PASSWORD=<password>
Environment=POSTGRES_DB=gevulot
Network=host
ExposeHostPort=5432
Volume=/var/lib/postgresql/data:/var/lib/postgresql/data:z
```


### Database migration

In order to create initial tables or perform latest migrations, run:
```
podman run -it --network=host quay.io/gevulot/node:latest migrate [--db-url=<DB URL>]
podman run -it --network=host quay.io/gevulot/node:latest migrate [--db-url=postgres://<username>:<password>@<dbhost>/gevulot]
```

## Gevulot user
Expand Down

0 comments on commit 47bac18

Please sign in to comment.