From 07333806fc7b38f744b50b901fe89cb648527767 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 20:06:44 +0100 Subject: [PATCH 1/7] Deploy to Heroku --- Dockerfile | 28 ++++++------------------ conf/app.ini | 0 deploy.sh | 20 +++++++++++++++++ heroku.yml | 19 ++-------------- run.sh | 62 +++++++++++++++++++--------------------------------- 5 files changed, 51 insertions(+), 78 deletions(-) delete mode 100644 conf/app.ini create mode 100755 deploy.sh diff --git a/Dockerfile b/Dockerfile index 78d1e9b..878306b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,11 @@ -FROM gitea/gitea:1.14.5-rootless -ARG DATABASE_URL -ENV DATABASE_URL=${DATABASE_URL} -COPY --chown=root:root run.sh /usr/local/bin/ -ADD conf/ /var/lib/gitea/custom/conf/ -USER root -RUN chmod 755 /usr/local/bin/run.sh -RUN chmod a+rwx /var/lib/gitea/custom/conf/app.ini +FROM gitea/gitea:1.14.5 -USER 1000:1000 +WORKDIR /app -CMD ["/usr/local/bin/run.sh"] +COPY run.sh ./ +# ENV GITEA_CUSTOM=/var/lib/gitea/custom -#FROM gitea/gitea:1.14.5 -# -#WORKDIR /app -# -#COPY run.sh ./ -# -#ENV GITEA_CUSTOM=/var/lib/gitea/custom -# -#RUN chmod +x ./run.sh -# -#ENTRYPOINT ["./run.sh"] +RUN chmod +x ./run.sh + +ENTRYPOINT ["./run.sh"] diff --git a/conf/app.ini b/conf/app.ini deleted file mode 100644 index e69de29..0000000 diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..a4ade73 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# App name +APP_NAME=s464951-gitea + +WEB_URL=$(heroku create --stack container --region eu $APP_NAME --json | jq -r '.web_url') +echo $WEB_URL + +# Add Heroku Postgres add-on +heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME + +echo echo $DATABASE_URL +# Push to Heroku +heroku git:remote --app $APP_NAME +git add . +git commit -m "Deploy to Heroku" +git push heroku main + +# Open the app in the browser +heroku open --app $APP_NAME \ No newline at end of file diff --git a/heroku.yml b/heroku.yml index 8382201..3315a0f 100644 --- a/heroku.yml +++ b/heroku.yml @@ -1,23 +1,8 @@ setup: addons: - - plan: heroku-postgresql:standard-0 + - plan: heroku-postgresql as: DATABASE + build: docker: web: Dockerfile -run: - web: /usr/local/bin/run.sh - - -#setup: -# addons: -# - plan: heroku-postgresql -# as: DATABASE -## config: -## POSTGRES_USER: "gitea" -## POSTGRES_PASSWORD: "gitea" -## POSTGRES_DB: "gitea" -# -#build: -# docker: -# web: Dockerfile diff --git a/run.sh b/run.sh index 851c394..5cce56d 100644 --- a/run.sh +++ b/run.sh @@ -1,45 +1,27 @@ +#!/bin/bash + +echo APP_URL: +echo $APP_URL +echo DATABASE_URL: +echo $DATABASE_URL + HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"` PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` -printf "[server]\nHTTP_PORT = $PORT;\n" > /var/lib/gitea/custom/conf/app.ini -printf "DOMAIN = $HEROKU_APP_DEFAULT_DOMAIN_NAME\n" >> /var/lib/gitea/custom/conf/app.ini -printf "\n[database]\nDB_TYPE = postgres;\n" >> /var/lib/gitea/custom/conf/app.ini -printf "NAME = $NAME;\n" >> /var/lib/gitea/custom/conf/app.ini -printf "HOST = $HOST;\n" >> /var/lib/gitea/custom/conf/app.ini -printf "USER = $USER;\n" >> /var/lib/gitea/custom/conf/app.ini -printf "PASSWD = $PASSWD;\n" >> /var/lib/gitea/custom/conf/app.ini -printf "SSL_MODE=require ;\n" >> /var/lib/gitea/custom/conf/app.ini + +mkdir -p /var/lib/gitea/custom/conf + +echo "[server]" > /var/lib/gitea/custom/conf/app.ini +echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini + +echo "[database]" >> /var/lib/gitea/custom/conf/app.ini +echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini +echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini +echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini +echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini +echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini +echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini + cat /var/lib/gitea/custom/conf/app.ini -/usr/local/bin/gitea web -port $PORT - - - -##!/bin/bash -# -# -# -#echo $APP_URL -#echo DATABASE_URL -#echo $DATABASE_URL -# -#HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` -#NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` -#USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"` -#PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` -# -#mkdir -p /var/lib/gitea/custom/conf -# -#echo "[server]" > /var/lib/gitea/custom/conf/app.ini -#echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini -# -#echo "[database]" >> /var/lib/gitea/custom/conf/app.ini -#echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini -#echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini -#echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini -#echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini -#echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini -#echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini -# -#cat /var/lib/gitea/custom/conf/app.ini -#/usr/local/bin/gitea web --port $PORT \ No newline at end of file +/usr/local/bin/gitea web --port $PORT \ No newline at end of file From 251d503358bd910e223a95f12d48bf60f12c5597 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 20:23:38 +0100 Subject: [PATCH 2/7] Deploy to Heroku --- deploy.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index a4ade73..bb27655 100755 --- a/deploy.sh +++ b/deploy.sh @@ -9,7 +9,21 @@ echo $WEB_URL # Add Heroku Postgres add-on heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME -echo echo $DATABASE_URL + +while true; do + ADDON_STATUS=$(heroku addons:info heroku-postgresql --app $APP_NAME | grep 'State:' | awk '{print $2}') + echo "Postgres add-on state: $ADDON_STATUS" + + if [ "$ADDON_STATUS" == "created" ]; then + echo "Heroku Postgres add-on is ready!" + break + fi + + echo "Waiting for Postgres add-on to be ready..." + sleep 5 +done + +echo $DATABASE_URL # Push to Heroku heroku git:remote --app $APP_NAME git add . From f0e4ac1948f84134751e2de93ee0c30c47d82567 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 20:35:59 +0100 Subject: [PATCH 3/7] Deploy to Heroku --- deploy.sh | 27 +++++++++++++++------------ heroku-app.txt | 1 + run.sh | 45 +++++++++++++++++++++++++-------------------- 3 files changed, 41 insertions(+), 32 deletions(-) create mode 100644 heroku-app.txt diff --git a/deploy.sh b/deploy.sh index bb27655..dc67183 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,24 +4,27 @@ APP_NAME=s464951-gitea WEB_URL=$(heroku create --stack container --region eu $APP_NAME --json | jq -r '.web_url') -echo $WEB_URL +echo $WEB_URL > heroku-app.txt # Add Heroku Postgres add-on heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME -while true; do - ADDON_STATUS=$(heroku addons:info heroku-postgresql --app $APP_NAME | grep 'State:' | awk '{print $2}') - echo "Postgres add-on state: $ADDON_STATUS" +#while true; do +# ADDON_STATUS=$(heroku addons:info heroku-postgresql --app $APP_NAME | grep 'State:' | awk '{print $2}') +# echo "Postgres add-on state: $ADDON_STATUS" +# +# if [ "$ADDON_STATUS" == "created" ]; then +# echo "Heroku Postgres add-on is ready!" +# break +# fi +# +# echo "Waiting for Postgres add-on to be ready..." +# sleep 5 +#done - if [ "$ADDON_STATUS" == "created" ]; then - echo "Heroku Postgres add-on is ready!" - break - fi - - echo "Waiting for Postgres add-on to be ready..." - sleep 5 -done +echo "Waiting for Heroku Postgres to be fully provisioned..." +heroku pg:wait --app $APP_NAME echo $DATABASE_URL # Push to Heroku diff --git a/heroku-app.txt b/heroku-app.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/heroku-app.txt @@ -0,0 +1 @@ + diff --git a/run.sh b/run.sh index 5cce56d..bfbb2e4 100644 --- a/run.sh +++ b/run.sh @@ -1,27 +1,32 @@ #!/bin/bash -echo APP_URL: -echo $APP_URL -echo DATABASE_URL: -echo $DATABASE_URL +# Database type +DB_TYPE=postgres -HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` -NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` -USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"` -PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` +# SSL mode +SSL_MODE=require +# Extract database credentials from DATABASE_URL +if [[ $DATABASE_URL =~ ^postgres://([^:]*):([^@]*)@([^:]*):([0-9]+)/([^/]*)$ ]]; then + USER="${BASH_REMATCH[1]}" + PASSWD="${BASH_REMATCH[2]}" + HOST="${BASH_REMATCH[3]}:${BASH_REMATCH[4]}" + NAME="${BASH_REMATCH[5]}" +else + echo "Invalid DATABASE_URL: $DATABASE_URL" + exit 1 +fi + +# Get app url +FILE=/app/heroku-app.txt +ROOT_URL=$(cat $FILE) + +# Custom configuration mkdir -p /var/lib/gitea/custom/conf -echo "[server]" > /var/lib/gitea/custom/conf/app.ini -echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini +# Add custom configuration +printf "[server]\nROOT_URL = $ROOT_URL\n" > /var/lib/gitea/custom/conf/app.ini +printf "[database]\nDB_TYPE = $DB_TYPE\nHOST = $HOST\nNAME = $NAME\nUSER = $USER\nPASSWD = $PASSWD\nSSL_MODE = $SSL_MODE\n" >> /var/lib/gitea/custom/conf/app.ini -echo "[database]" >> /var/lib/gitea/custom/conf/app.ini -echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini -echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini -echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini -echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini -echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini -echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini - -cat /var/lib/gitea/custom/conf/app.ini -/usr/local/bin/gitea web --port $PORT \ No newline at end of file +# Start Gitea +/usr/local/bin/gitea web -port $PORT \ No newline at end of file From 62b07630b7ad22b62a0e2c0f06facb9049292498 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 21:12:07 +0100 Subject: [PATCH 4/7] Deploy to Heroku --- Dockerfile | 1 - app_url.txt | 1 + deploy.sh | 22 ++++------------------ run.sh | 45 ++++++++++++++++++++------------------------- 4 files changed, 25 insertions(+), 44 deletions(-) create mode 100644 app_url.txt diff --git a/Dockerfile b/Dockerfile index 878306b..cc24add 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ WORKDIR /app COPY run.sh ./ -# ENV GITEA_CUSTOM=/var/lib/gitea/custom RUN chmod +x ./run.sh diff --git a/app_url.txt b/app_url.txt new file mode 100644 index 0000000..ce1fb77 --- /dev/null +++ b/app_url.txt @@ -0,0 +1 @@ +https://s464951-gitea-451bd4d0ed7a.herokuapp.com/ diff --git a/deploy.sh b/deploy.sh index dc67183..cb26757 100755 --- a/deploy.sh +++ b/deploy.sh @@ -3,30 +3,16 @@ # App name APP_NAME=s464951-gitea -WEB_URL=$(heroku create --stack container --region eu $APP_NAME --json | jq -r '.web_url') -echo $WEB_URL > heroku-app.txt +heroku create --stack container --region eu $APP_NAME --json +APP_URL=$(heroku info -s | grep web_url | cut -d= -f2) + +echo $APP_URL > app_url.txt -# Add Heroku Postgres add-on heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME - -#while true; do -# ADDON_STATUS=$(heroku addons:info heroku-postgresql --app $APP_NAME | grep 'State:' | awk '{print $2}') -# echo "Postgres add-on state: $ADDON_STATUS" -# -# if [ "$ADDON_STATUS" == "created" ]; then -# echo "Heroku Postgres add-on is ready!" -# break -# fi -# -# echo "Waiting for Postgres add-on to be ready..." -# sleep 5 -#done - echo "Waiting for Heroku Postgres to be fully provisioned..." heroku pg:wait --app $APP_NAME -echo $DATABASE_URL # Push to Heroku heroku git:remote --app $APP_NAME git add . diff --git a/run.sh b/run.sh index bfbb2e4..5cce56d 100644 --- a/run.sh +++ b/run.sh @@ -1,32 +1,27 @@ #!/bin/bash -# Database type -DB_TYPE=postgres +echo APP_URL: +echo $APP_URL +echo DATABASE_URL: +echo $DATABASE_URL -# SSL mode -SSL_MODE=require +HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` +NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` +USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"` +PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` -# Extract database credentials from DATABASE_URL -if [[ $DATABASE_URL =~ ^postgres://([^:]*):([^@]*)@([^:]*):([0-9]+)/([^/]*)$ ]]; then - USER="${BASH_REMATCH[1]}" - PASSWD="${BASH_REMATCH[2]}" - HOST="${BASH_REMATCH[3]}:${BASH_REMATCH[4]}" - NAME="${BASH_REMATCH[5]}" -else - echo "Invalid DATABASE_URL: $DATABASE_URL" - exit 1 -fi - -# Get app url -FILE=/app/heroku-app.txt -ROOT_URL=$(cat $FILE) - -# Custom configuration mkdir -p /var/lib/gitea/custom/conf -# Add custom configuration -printf "[server]\nROOT_URL = $ROOT_URL\n" > /var/lib/gitea/custom/conf/app.ini -printf "[database]\nDB_TYPE = $DB_TYPE\nHOST = $HOST\nNAME = $NAME\nUSER = $USER\nPASSWD = $PASSWD\nSSL_MODE = $SSL_MODE\n" >> /var/lib/gitea/custom/conf/app.ini +echo "[server]" > /var/lib/gitea/custom/conf/app.ini +echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini -# Start Gitea -/usr/local/bin/gitea web -port $PORT \ No newline at end of file +echo "[database]" >> /var/lib/gitea/custom/conf/app.ini +echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini +echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini +echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini +echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini +echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini +echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini + +cat /var/lib/gitea/custom/conf/app.ini +/usr/local/bin/gitea web --port $PORT \ No newline at end of file From 7d8b7b6005aee401afdff2deed805dd347e73518 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 21:44:23 +0100 Subject: [PATCH 5/7] Deploy to Heroku --- Dockerfile | 1 - app_url.txt | 2 +- deploy.sh | 5 ++++- run.sh | 11 +++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc24add..334c347 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ WORKDIR /app COPY run.sh ./ - RUN chmod +x ./run.sh ENTRYPOINT ["./run.sh"] diff --git a/app_url.txt b/app_url.txt index ce1fb77..ac4ee56 100644 --- a/app_url.txt +++ b/app_url.txt @@ -1 +1 @@ -https://s464951-gitea-451bd4d0ed7a.herokuapp.com/ +https://s464951-gitea-530091612f47.herokuapp.com/ diff --git a/deploy.sh b/deploy.sh index cb26757..475d7b9 100755 --- a/deploy.sh +++ b/deploy.sh @@ -13,6 +13,9 @@ heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME echo "Waiting for Heroku Postgres to be fully provisioned..." heroku pg:wait --app $APP_NAME +echo DATABASE_URL +echo $DATABASE_URL + # Push to Heroku heroku git:remote --app $APP_NAME git add . @@ -20,4 +23,4 @@ git commit -m "Deploy to Heroku" git push heroku main # Open the app in the browser -heroku open --app $APP_NAME \ No newline at end of file +# heroku open --app $APP_NAME \ No newline at end of file diff --git a/run.sh b/run.sh index 5cce56d..5ef478a 100644 --- a/run.sh +++ b/run.sh @@ -1,9 +1,9 @@ #!/bin/bash -echo APP_URL: -echo $APP_URL -echo DATABASE_URL: -echo $DATABASE_URL + +FILE=/app/app_url.txt +ROOT_URL=$(cat $FILE) + HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` @@ -13,7 +13,7 @@ PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"` mkdir -p /var/lib/gitea/custom/conf echo "[server]" > /var/lib/gitea/custom/conf/app.ini -echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini +echo "ROOT_URL = $ROOT_URL >> /var/lib/gitea/custom/conf/app.ini echo "[database]" >> /var/lib/gitea/custom/conf/app.ini echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini @@ -23,5 +23,4 @@ echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini echo "SSL_MODE = require" >> /var/lib/gitea/custom/conf/app.ini -cat /var/lib/gitea/custom/conf/app.ini /usr/local/bin/gitea web --port $PORT \ No newline at end of file From 9c56cc6f2900d16f1f34cf38d289747a39d203da Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 21:52:56 +0100 Subject: [PATCH 6/7] Deploy to Heroku --- Dockerfile | 2 ++ app_url.txt | 2 +- deploy.sh | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 334c347..ab3ba52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,10 @@ FROM gitea/gitea:1.14.5 WORKDIR /app +COPY app_url.txt ./ COPY run.sh ./ +USER root RUN chmod +x ./run.sh ENTRYPOINT ["./run.sh"] diff --git a/app_url.txt b/app_url.txt index ac4ee56..b1cab7c 100644 --- a/app_url.txt +++ b/app_url.txt @@ -1 +1 @@ -https://s464951-gitea-530091612f47.herokuapp.com/ +https://s464951-gitea-fa34820a73f7.herokuapp.com/ diff --git a/deploy.sh b/deploy.sh index 475d7b9..871bf01 100755 --- a/deploy.sh +++ b/deploy.sh @@ -13,8 +13,9 @@ heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME echo "Waiting for Heroku Postgres to be fully provisioned..." heroku pg:wait --app $APP_NAME -echo DATABASE_URL -echo $DATABASE_URL +echo DB_URL +heroku config:get DATABASE_URL -a $APP_NAME + # Push to Heroku heroku git:remote --app $APP_NAME @@ -23,4 +24,4 @@ git commit -m "Deploy to Heroku" git push heroku main # Open the app in the browser -# heroku open --app $APP_NAME \ No newline at end of file +heroku open --app $APP_NAME \ No newline at end of file From d62381aeca11d5db1b868a637c937b31e8243f75 Mon Sep 17 00:00:00 2001 From: asmigiel Date: Tue, 7 Jan 2025 22:11:31 +0100 Subject: [PATCH 7/7] test --- Dockerfile | 2 +- run.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab3ba52..deb94c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM gitea/gitea:1.14.5 +FROM gitea/gitea:1.14.5-rootless WORKDIR /app diff --git a/run.sh b/run.sh index 5ef478a..9b0fe5d 100644 --- a/run.sh +++ b/run.sh @@ -1,10 +1,10 @@ #!/bin/bash -FILE=/app/app_url.txt +FILE=./app_url.txt ROOT_URL=$(cat $FILE) - +printf($ROOT_URL) HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-` NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-` USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"`