Compare commits
24 Commits
8a76c3e47d
...
4de784eb54
Author | SHA1 | Date | |
---|---|---|---|
|
4de784eb54 | ||
|
1126f1f12e | ||
|
6ef5d5d1e6 | ||
|
e76265b68d | ||
|
b56fa05ddf | ||
|
836df4270e | ||
|
b322b0e35c | ||
|
d000f389e7 | ||
|
faaabd1200 | ||
|
0824676343 | ||
|
c9105f300c | ||
|
b61bee0220 | ||
|
9687f022af | ||
|
a2cc89f0ec | ||
|
85546a29a1 | ||
|
b38f9a0eb1 | ||
|
319abacc59 | ||
|
b164162f3d | ||
|
2c9afae4d5 | ||
|
d722cdac45 | ||
|
a01d30819a | ||
|
736eb33ee0 | ||
|
0a5457ab16 | ||
|
b68433891e |
13
Dockerfile
13
Dockerfile
@ -1,8 +1,19 @@
|
||||
FROM gitea/gitea:1.14.5-rootless
|
||||
|
||||
|
||||
ADD data /var/lib/gitea
|
||||
ADD conf/ /var/lib/gitea/custom/conf/
|
||||
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
|
||||
|
||||
USER 1000:1000
|
||||
|
||||
ENV DATABASE_URL=${DATABASE_URL}
|
||||
|
||||
CMD ["/usr/local/bin/parse_db_url.sh"]
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
[database]
|
||||
DB_TYPE = postgres
|
||||
HOST = db:5432
|
||||
NAME = gitea
|
||||
USER = gitea
|
||||
PASSWD = gitea
|
||||
SSL_MODE = require
|
@ -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
|
||||
|
@ -1,12 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
export GITEA__database__DB_TYPE=${DATABASE_URL%%:*}
|
||||
export GITEA__database__USER=$(echo ${DATABASE_URL} | sed -r "s|.*://([^:]+):.*|\1|")
|
||||
export GITEA__database__PASSWD=$(echo ${DATABASE_URL} | sed -r "s|.*://[^:]+:([^@]+)@.*|\1|")
|
||||
export GITEA__database__HOST=$(echo ${DATABASE_URL} | sed -r "s|.*@([^:]+):.*|\1|")
|
||||
export GITEA__database__NAME=$(echo ${DATABASE_URL} | sed -r "s|.*:([0-9]+)/([^?]+).*|\2|")
|
||||
DATABASE_URL=$(echo $DATABASE_URL)
|
||||
|
||||
echo $DATABASE_URL
|
||||
echo $GITEA__database__NAME
|
||||
DB_TYPE="postgres"
|
||||
USER=$(echo $DATABASE_URL | sed -e 's,.*//\(.*\):.*@.*,\1,')
|
||||
PASSWD=$(echo $DATABASE_URL | sed -e 's,.*//.*:\(.*\)@.*,\1,')
|
||||
HOST=$(echo $DATABASE_URL | sed -e 's,.*@\(.*\):\(.*\)/.*,\1,')
|
||||
PORT_DB=$(echo $DATABASE_URL | sed -e 's,.*@.*:\(.*\)/.*,\1,')
|
||||
NAME=$(echo $DATABASE_URL | sed -e 's,.*/\(.*\)$,\1,')
|
||||
|
||||
exec /usr/local/bin/gitea web -port $PORT
|
||||
SSL_MODE="require"
|
||||
|
||||
printf "\n[server]\n" >> /var/lib/gitea/custom/conf/app.ini
|
||||
printf "HTTP_PORT = $PORT\n" >> /var/lib/gitea/custom/conf/app.ini
|
||||
|
||||
printf "[database]\n" >> /var/lib/gitea/custom/conf/app.ini
|
||||
printf "DB_TYPE = $DB_TYPE\n" >> /var/lib/gitea/custom/conf/app.ini
|
||||
printf "HOST = $HOST:$PORT_DB\n" >> /var/lib/gitea/custom/conf/app.ini
|
||||
printf "NAME = $NAME\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 = $SSL_MODE\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