From 592639d1e86ba11dec6459a364eda3e94115a337 Mon Sep 17 00:00:00 2001 From: awieczarek Date: Sun, 20 Oct 2024 15:19:19 +0200 Subject: [PATCH] Test --- Dockerfile | 11 +++++++++++ heroku.yml | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35355ae..1768278 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,3 +5,14 @@ ADD config /etc/gitea ADD data /var/lib/gitea ADD localtime /etc/localtime ADD timezone /etc/timezone + + +RUN echo '#!/bin/sh' > /parse_db_url.sh && \ + echo 'export GITEA__database__DB_TYPE=${DATABASE_URL%%:*}' >> /parse_db_url.sh && \ + echo 'export GITEA__database__USER=$(echo ${DATABASE_URL} | sed -r "s|.*://([^:]+):.*|\1|")' >> /parse_db_url.sh && \ + echo 'export GITEA__database__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^@]+)@.*|\1|")' >> /parse_db_url.sh && \ + echo 'export GITEA__database__HOST=$(echo ${DATABASE_URL} | sed -r "s|.*@([^:]+):.*|\1|")' >> /parse_db_url.sh && \ + echo 'export GITEA__database__NAME=$(echo ${DATABASE_URL} | sed -r "s|.*:([0-9]+)/([^?]+).*|\2|")' >> /parse_db_url.sh && \ + chmod +x /parse_db_url.sh + +ENTRYPOINT ["/bin/sh", "-c", "/parse_db_url.sh && /usr/local/bin/gitea web -port $PORT"] diff --git a/heroku.yml b/heroku.yml index 7d3837d..46b37e9 100644 --- a/heroku.yml +++ b/heroku.yml @@ -7,5 +7,3 @@ build: docker: web: Dockerfile -run: - web: /usr/local/bin/gitea web -port $PORT