heroku-gitea/Dockerfile

19 lines
929 B
Docker
Raw Normal View History

2024-10-19 13:11:55 +02:00
FROM gitea/gitea:1.14.5-rootless
2024-10-20 14:59:11 +02:00
ADD conf/ /var/lib/gitea/custom/conf/
2024-10-20 15:11:29 +02:00
ADD config /etc/gitea
ADD data /var/lib/gitea
ADD localtime /etc/localtime
ADD timezone /etc/timezone
2024-10-20 15:19:19 +02:00
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"]