not tested config

This commit is contained in:
asmigiel 2024-12-22 22:15:01 +01:00
parent 4948aae4cc
commit 6c75249ca4
5 changed files with 36 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/venv
.idea
/postgres

View File

@ -0,0 +1,7 @@
FROM gitea/gitea:1.14.5-rootless
RUN mkdir -p /data/gitea
EXPOSE 3000
CMD ["/usr/bin/gitea", "web"]

0
config/app.ini Normal file
View File

View File

@ -10,3 +10,6 @@ setup:
build:
docker:
web: Dockerfile
run:
web: ./start.sh

23
run.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
export DB_HOST=$(heroku config:get DATABASE_URL | sed 's/.*\/\/\(.*\):\(.*\)\/.*/\1/')
export DB_USER=$(heroku config:get DATABASE_URL | sed 's/.*\/\/\(.*\):\(.*\)\/.*/\1/')
export DB_PASSWORD=$(heroku config:get DATABASE_URL | sed 's/.*:\/\/.*:\(.*\)@.*/\1/')
export DB_NAME=$(heroku config:get DATABASE_URL | sed 's/.*\/\(.*\)/\1/')
cat > /data/gitea/conf/app.ini <<EOL
[database]
DB_TYPE = postgres
HOST = ${DB_HOST}
NAME = ${DB_NAME}
USER = ${DB_USER}
PASSWD = ${DB_PASSWORD}
SSL_MODE = require
[server]
DOMAIN = ${HEROKU_APP_DEFAULT_DOMAIN_NAME}
HTTP_PORT = ${PORT}
EOL
/usr/bin/gitea web