scripts/fogcutter/docker/gitea.sh

42 lines
992 B
Bash
Executable File

#!/bin/bash
set -e
up () {
# Ensure iptables rules exist
# https://askubuntu.com/questions/1052919/iptables-reload-restart-on-ubuntu/1072948#1072948
docker network create --ipv6 --subnet "fd01::/80" pew-net || true
# Exposed on port 3000 in pew-net
docker run \
--detach \
--name gitea \
--restart unless-stopped \
--env RUN_MODE=prod \
--env DOMAIN=git.seaturtle.pw \
--env SSH_DOMAIN=git.seaturtle.pw \
--env SSH_PORT=2222 \
--env ROOT_URL=https://git.seaturtle.pw \
--env LFS_START=true \
--env DISABLE_REGISTRATION=true \
--env REQUIRE_SIGNIN_VIEW=false \
--env USER_UID=1000 \
--volume /bigdata/k8s-config/gitea/data:/data:rw \
--volume /etc/localtime:/etc/localtime:ro \
--volume /etc/timezone:/etc/timezone:ro \
--publish 2222:2222 \
--network pew-net \
docker.io/gitea/gitea:latest
}
down () {
docker stop gitea || true
docker rm gitea || true
}
logs () {
docker logs --follow gitea
}
$@