Skip to content

Instantly share code, notes, and snippets.

@lboulard
Created November 9, 2024 17:04
Show Gist options
  • Save lboulard/f5f814a012d756cfb79d07a6d24d63f6 to your computer and use it in GitHub Desktop.
Save lboulard/f5f814a012d756cfb79d07a6d24d63f6 to your computer and use it in GitHub Desktop.
Quick and dirty docker Gitea rootless server
# Quick and dirty docker Gitea rootless server
#
# Prepare host with a "git" account for gitea inside docker
#
# $ useradd -d /data/gitea/git -M --system git
# $ getent passwd git
# gitea:x:995:992::/data/gitea/git:/bin/sh
#
# $ install -d -o git -g git -m 750 /data/gitea /data/gitea/config /data/gitea/data
#
# IMPORTANT: replace 'user: "995:992"' and "USER=995" in this file
# with numeric UID and GID of "git" account.
# Add to /etc/caddy/Caddyfile:
# git.lan.lboulard.net {
# reverse_proxy localhost:3000
# }
networks:
gitea:
external: false
services:
gitea:
image: gitea/gitea:1.22.3-rootless
container_name: gitea
user: "995:992"
environment:
- "APP_NAME=Gitea: lboulard LAN"
- "USER=995"
- "DISABLE_SSH=true"
- "SSH_PORT=2222"
- "DISABLE_REGISTRATION=true"
- "GITEA____DISABLE_STARS=true"
- "GITEA____DEFAULT_BRANCH=master"
- "GITEA____RUN_USER=995"
- "GITEA__server__DOMAIN=git.lan.lboulard.net"
- "GITEA__server__ROOT_URL=https://git.lan.lboulard.net/"
- "GITEA__server__DISABLE_SSH=true"
- "GITEA__server__SSH_PORT=2222"
- "GITEA__server__LFS_START_SERVER=true"
- "GITEA__server__START_SSH_SERVER=false"
- "GITEA__openid__ENABLE_OPENID_SIGNIN=false"
- "GITEA__openid__ENABLE_OPENID_SIGNUP=false"
- "GITEA__repository__FORCE_PRIVATE=true"
- "GITEA__repository__ENABLE_PUSH_CREATE_USER=true"
- "GITEA__repository__ENABLE_PUSH_CREATE_ORG=true"
- "GITEA__repository_0X2E_upload__FILE_MAX_SIZE=1024"
- "GITEA__admin__EFAULT_EMAIL_NOTIFICATIONS=false"
- "GITEA__security__DISABLE_GIT_HOOKS=false"
- "GITEA__session__SESSION_LIFE_TIME=8640000"
- "GITEA__service__DISABLE_REGISTRATION=true"
restart: unless-stopped
networks:
- gitea
volumes:
- /data/gitea/data:/var/lib/gitea
- /data/gitea/config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:3000:3000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment