Skip to content

Commit

Permalink
Provide more complete information on Running the Flask app
Browse files Browse the repository at this point in the history
This commit adds more information about how to set up the
`pg-backup-api` systemd unit, and how to change the `pg-backup-api-config.py`
file.

It also makes it clearer the difference between running the
`pg-backup-api serve` command and running the `pg-backup-api` service.

Signed-off-by: Israel Barth Rubio <[email protected]>
  • Loading branch information
barthisrael committed Aug 10, 2023
1 parent de1a1ac commit dee7b62
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,22 @@ pg-backup-api serve
behavior by passing `--port N` to `serve` command, `N` being the port to listen
on.

The above comand will start up the REST API as a development server. If you
want to run the REST API as an WSGI application, use the approach described in
the `Service` section.

### Service

If you are running `pg-backup-api` from a local source directory, copy
`pg-backup-api/packaging/pg-backup-api.service` to `/etc/systemd/system/`. If
you've installed `pg-backup-api` as a package, installation puts the service
file in the right place for you.
If you intend to run `pg-backup-api` from a local source directory, then you
need to set up the `pg-backup-api` service. You need to copy a couple files
from the [pg-backup-api-packaging repo](https://github.com/EnterpriseDB/pg-backup-api-packaging):

1. Copy `packaging/etc/systemd/system/pg-backup-api.service.in` to
`/etc/systemd/system/pg-backup-api.service`
2. Copy `packaging/etc/pg-backup-api-config.py` to `/etc/pg-backup-api-config.py`

If you have installed the `pg-backup-api` package, the package installation puts
the service and configuration files in the right place for you.

Once the systemd services are in the right place, run the following command to
enable `pg-backup-api` startup on machine boot, and immediatelly start it:
Expand All @@ -60,6 +70,9 @@ enable `pg-backup-api` startup on machine boot, and immediatelly start it:
systemctl enable pg-backup-api --now
```

**Note:** by default the `pg-backup-api` service runs on port `7480`. You can
override that behavior by changing the port in `/etc/pg-backup-api-config.py`.

### Verify the app

You can check if the application is up and running by executing this command:
Expand Down

0 comments on commit dee7b62

Please sign in to comment.