https://github.com/ohld/dokku-prefect
https://github.com/ohld/dokku-prefect
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ohld/dokku-prefect
- Owner: ohld
- License: apache-2.0
- Created: 2023-05-16T17:51:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-18T12:30:56.000Z (about 3 years ago)
- Last Synced: 2025-03-26T08:12:56.205Z (about 1 year ago)
- Language: Python
- Size: 13.7 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dokku-prefect
## How to deploy
### TL;DR:
1. Create Dokku app, link Postgres
2. Clone this Template
3. Set CI/CD envs in Github repo settings
4. Push something to trigger deploy
5. Enable Https if required
### Create Dokku app
On your server (where Dokku is installed):
``` sh
dokku apps:create prefect
dokku config:set prefect POSTGRES_DATABASE_SCHEME=postgresql+asyncpg \
PREFECT_API_URL=https://prefect.yourdomain.com/api
dokku postgres:create prefect
dokku postgres:link prefect prefect -a PREFECT_API_DATABASE_CONNECTION
```
Read more about [Prefect database connection](https://docs.prefect.io/latest/host/#configuring-a-postgresql-database) for self-hosted production deployment.
### CI/CD envs
In order to enable Dokku auto deployment after a commit / PR to _main_ branch, you need to set Repo secrets in Github repo's settings:
1. Open
Settings -> Secrets and variables -> Actions -> New repository secret
2. Set variables
- SSH_PRIVATE_KEY (`cat .ssh/id_rsa` & copy-paste your key)
- DOKKU_HOST (e.g. myserver.dokku.com)
- DOKKU_APP_NAME (e.g. prefect)
### How to enable Https
``` sh
dokku letsencrypt:enable prefect
```
### How to enable https basic auth
``` sh
dokku plugin:install https://github.com/dokku/dokku-http-auth.git
dokku http-auth:enable prefect admin admin_password
dokku http-auth:add-allowed-ip app $(curl http://icanhazip.com/)
dokku ps:restart prefect
```
Don't forget to disable Cloudflare Proxy to allow `add-allowed-ip` do its job.