test no sh
This commit is contained in:
parent
4d09f79a30
commit
a3bb5db8a1
28
Dockerfile
28
Dockerfile
@ -1,12 +1,20 @@
|
|||||||
FROM gitea/gitea:1.14.5-rootless
|
#FROM gitea/gitea:1.14.5
|
||||||
ARG DATABASE_URL
|
#
|
||||||
ENV DATABASE_URL=${DATABASE_URL}
|
#WORKDIR /app
|
||||||
COPY --chown=root:root run.sh /usr/local/bin/
|
#
|
||||||
ADD conf/ /var/lib/gitea/custom/conf/
|
#COPY run.sh ./
|
||||||
USER root
|
#
|
||||||
RUN chmod 755 /usr/local/bin/run.sh
|
#ENV GITEA_CUSTOM=/var/lib/gitea/custom
|
||||||
RUN chmod a+rwx /var/lib/gitea/custom/conf/app.ini
|
#
|
||||||
|
#RUN chmod +x ./run.sh
|
||||||
|
#
|
||||||
|
#ENTRYPOINT ["./run.sh"]
|
||||||
|
|
||||||
USER 1000:1000
|
|
||||||
|
|
||||||
CMD ["/usr/local/bin/run.sh"]
|
FROM gitea/gitea:1.14.5
|
||||||
|
|
||||||
|
|
||||||
|
COPY ./data /var/lib/gitea
|
||||||
|
COPY ./config /etc/gitea
|
||||||
|
|
||||||
|
EXPOSE 3000 2222
|
||||||
|
23
heroku.yml
23
heroku.yml
@ -1,15 +1,18 @@
|
|||||||
setup:
|
|
||||||
addons:
|
|
||||||
- plan: heroku-postgresql
|
|
||||||
as: DATABASE
|
|
||||||
# config:
|
|
||||||
# POSTGRES_USER: "gitea"
|
|
||||||
# POSTGRES_PASSWORD: "gitea"
|
|
||||||
# POSTGRES_DB: "gitea"
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
web: Dockerfile
|
web: Dockerfile
|
||||||
|
|
||||||
run:
|
run:
|
||||||
web: /usr/local/bin/run.sh
|
web: /usr/bin/entrypoint /bin/s6-svscan /etc/s6
|
||||||
|
|
||||||
|
addons:
|
||||||
|
- plan: heroku-postgresql
|
||||||
|
as: DATABASE
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA__database__DB_TYPE: postgres
|
||||||
|
GITEA__database__HOST: ${DATABASE_URL}
|
||||||
|
GITEA__database__NAME: gitea
|
||||||
|
GITEA__database__USER: gitea
|
||||||
|
GITEA__database__PASSWD: gitea
|
||||||
|
|
||||||
|
54
run.sh
54
run.sh
@ -2,43 +2,27 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo $APP_URL
|
||||||
|
echo DATABASE_URL
|
||||||
|
echo $DATABASE_URL
|
||||||
|
|
||||||
HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-`
|
HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-`
|
||||||
NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-`
|
NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-`
|
||||||
USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"`
|
USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"`
|
||||||
PASSWD=`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
|
|
||||||
cat /var/lib/gitea/custom/conf/app.ini
|
|
||||||
/usr/local/bin/gitea web -port $PORT
|
|
||||||
|
|
||||||
#
|
mkdir -p /var/lib/gitea/custom/conf
|
||||||
#echo $APP_URL
|
|
||||||
#echo DATABASE_URL
|
echo "[server]" > /var/lib/gitea/custom/conf/app.ini
|
||||||
#echo $DATABASE_URL
|
echo "ROOT_URL = $APP_URL" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#
|
|
||||||
#HOST=`echo $DATABASE_URL | grep -o "@.*/" | sed 's/.$//' | cut -c 2-`
|
echo "[database]" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#NAME=`echo $DATABASE_URL | grep -o "/[[:alnum:]]*$" | cut -c 2-`
|
echo "DB_TYPE = postgres" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#USER=`echo $DATABASE_URL | grep -o "//[[:alnum:]]*:" | grep -o "[[:alnum:]]*"`
|
echo "HOST = $HOST" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#PASSWD=`echo $DATABASE_URL | grep -o ":[[:alnum:]]*@" | grep -o "[[:alnum:]]*"`
|
echo "NAME = $NAME" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#
|
echo "USER = $USER" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#mkdir -p /var/lib/gitea/custom/conf
|
echo "PASSWD = $PASSWD" >> /var/lib/gitea/custom/conf/app.ini
|
||||||
#
|
echo "SSL_MODE = require" >> /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
|
cat /var/lib/gitea/custom/conf/app.ini
|
||||||
#
|
/usr/local/bin/gitea web --port $PORT
|
||||||
#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
|
|
Loading…
Reference in New Issue
Block a user