done 2.2
This commit is contained in:
commit
4c8501c369
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/venv
|
||||||
|
.idea
|
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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 ../heroku-gitea/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
|
||||||
|
|
||||||
|
USER 1000:1000
|
||||||
|
|
||||||
|
CMD ["/usr/local/bin/run.sh"]
|
0
conf/app.ini
Normal file
0
conf/app.ini
Normal file
9
heroku.yml
Normal file
9
heroku.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
setup:
|
||||||
|
addons:
|
||||||
|
- plan: heroku-postgresql
|
||||||
|
as: DATABASE
|
||||||
|
build:
|
||||||
|
docker:
|
||||||
|
web: Dockerfile
|
||||||
|
run:
|
||||||
|
web: /usr/local/bin/run.sh
|
13
run.sh
Normal file
13
run.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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 "[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
|
Loading…
Reference in New Issue
Block a user