Moving more config to the app

This commit is contained in:
Luke Murphy 2020-03-15 08:31:10 +01:00
parent a9747d79c9
commit bd18997cc0
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 45 additions and 1 deletions

View File

@ -2,9 +2,33 @@
"name": "gitea",
"description": "Gitea is a painless self-hosted Git service.",
"repository": "https://gitlab.com/autonomic-cooperative/gitea-dokku",
"dokku": {
"plugins": [
{ "name": "proxy", "commands": ["proxy:ports-add http:80:3000"] },
{
"name": "letsencrypt",
"commands": ["letsencrypt gitea", "letsencrypt:cron-job --add"]
}
]
},
"scripts": {
"dokku": {
"predeploy": "bash /app/predeploy.sh",
"postdeploy": "bash /app/postdeploy.sh"
}
},
"volumes": [
{
"host": "/var/lib/gitea",
"app": "/data"
},
{
"host": "/etc/timezone",
"app": "/etc/timezone:ro"
},
{
"host": "/etc/localtime",
"app": "/etc/localtime:ro"
}
]
}

20
predeploy.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -eu -o pipefail
setup_db() {
set -eu
echo "=====> Running database migration"
gitea migrate
}
main() {
set -eu
if [ -f "/data/gitea/conf/app.ini" ]; then
setup_db
fi
}
main