diff --git a/Dockerfile b/Dockerfile index 13381ef..7a2f5db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,3 +6,11 @@ ADD config /etc/gitea ADD data /var/lib/gitea ADD localtime /etc/localtime ADD timezone /etc/timezone +COPY parse_db_url.sh /usr/local/bin/parse_db_url.sh + +USER root +RUN chmod 755 /usr/local/bin/parse_db_url.sh +RUN chmod a+rwx /var/lib/gitea/custom/conf/app.ini + +ENTRYPOINT ["/usr/local/bin/parse_db_url.sh"] + diff --git a/conf/app.ini b/conf/app.ini index 0b888e3..e69de29 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -1,7 +0,0 @@ -[database] -DB_TYPE = postgres -HOST = db:5432 -NAME = gitea -USER = gitea -PASSWD = gitea -SSL_MODE = require diff --git a/heroku.yml b/heroku.yml index 4f05cbe..a37457c 100644 --- a/heroku.yml +++ b/heroku.yml @@ -16,6 +16,3 @@ build: GITEA__database__NAME: gitea GITEA__database__USER: gitea GITEA__database__PASSWD: gitea - -run: - web: /usr/local/bin/gitea web -port $PORT diff --git a/parse_db_url.sh b/parse_db_url.sh index 1e480e6..c0d6fab 100644 --- a/parse_db_url.sh +++ b/parse_db_url.sh @@ -6,7 +6,4 @@ export GITEA__database__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^ export GITEA__database__HOST=$(echo ${DATABASE_URL} | sed -r "s|.*@([^:]+):.*|\1|") export GITEA__database__NAME=$(echo ${DATABASE_URL} | sed -r "s|.*:([0-9]+)/([^?]+).*|\2|") -echo $DATABASE_URL -echo $GITEA__database__NAME - exec /usr/local/bin/gitea web -port $PORT