From 8a701ad8139b101be22a16193efbd8046eb6ef2b Mon Sep 17 00:00:00 2001 From: Last2014 Date: Sun, 30 Nov 2025 04:23:22 +0000 Subject: [PATCH] First commit --- .env.example | 13 +++++++++ .gitignore | 10 +++++++ docker-compose.yml | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100755 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f30b5e2 --- /dev/null +++ b/.env.example @@ -0,0 +1,13 @@ +RUN_MODE=prod +PUBLIC_PORT=3000 +ROOT_URL=https://gitea.last2014.com +POSTGRES_PASSWORD=PostgresPassword +MAIL_PROTOCOL=smtp+starttls +MAIL_HOST=mail.example.com +MAIL_PORT=587 +MAIL_IS_TLS=true +MAIL_USER=gitea@mail.example.com +MAIL_PASSWORD=MailPassword +MAIL_FROM=gitea@mail.example.com +TURNSTILE_SITEKEY=12345678 +TURNSTILE_SECRET=12345678 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c19b8b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +/.env* +!/.env.example + +/data/ +/postgres/ + +!/data/gitea/ +/data/gitea/** +!/data/gitea/templates/ +!/data/gitea/templates/** diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..1aedbea --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,73 @@ +services: + server: + image: docker.gitea.com/gitea:1.25.2 + restart: unless-stopped + environment: + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=db:5432 + - GITEA__database__NAME=gitea + - GITEA__database__USER=gitea + - GITEA__database__SSL_MODE=disable + - GITEA__database__PASSWD=${POSTGRES_PASSWORD} + - GITEA__server__PROTOCOL=http + - GITEA__server__DISABLE_SSH=true + - GITEA__server__START_SSH_SERVER=false + - GITEA__server__HTTP_ADDR=0.0.0.0 + - GITEA__server__HTTP_PORT=${PUBLIC_PORT} + - GITEA__server__ROOT_URL=${ROOT_URL} + - GITEA__server__LFS_START_SERVER=true + - GITEA__mailer__ENABLED=true + - GITEA__mailer__PROTOCOL=${MAIL_PROTOCOL} + - GITEA__mailer__SMTP_ADDR=${MAIL_HOST} + - GITEA__mailer__SMTP_PORT=${MAIL_PORT} + - GITEA__mailer__IS_TLS=${MAIL_IS_TLS} + - GITEA__mailer__USER=${MAIL_USER} + - GITEA__mailer__PASSWD=${MAIL_PASSWORD} + - GITEA__mailer__FROM=${MAIL_FROM} + - GITEA__service__ACTIVE_CODE_LIVE_MINUTES=10 + - GITEA__service__RESET_PASSWD_CODE_LIVE_MINUTES=10 + - GITEA__service__REGISTER_EMAIL_CONFIRM=true + - GITEA__service__ENABLE_NOTIFY_MAIL=true + - GITEA__service__ENABLE_BASIC_AUTHENTICATION=false + - GITEA__service__DISABLE_REGISTRATION=false + - GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION=false + - GITEA__service__REQUIRE_SIGNIN_VIEW=false + - GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE=true + - GITEA__service__DEFAULT_ALLOW_CREATE_ORGANIZATION=false + - GITEA__service__DEFAULT_ENABLE_TIMETRACKING=true + - GITEA__service__USER_LOCATION_MAP_URL=https://www.google.com/maps/search/?api=1&query= + - GITEA__service__ENABLE_CAPTCHA=true + - GITEA__service__REQUIRE_CAPTCHA_FOR_LOGIN=true + - GITEA__service__CAPTCHA_TYPE=cfturnstile + - GITEA__service__CF_TURNSTILE_SITEKEY=${TURNSTILE_SITEKEY} + - GITEA__service__CF_TURNSTILE_SECRET=${TURNSTILE_SECRET} + - GITEA__openid__ENABLE_OPENID_SIGNIN=false + - GITEA__openid__ENABLE_OPENID_SIGNUP=false + - GITEA__cron.update_checker__ENABLED=true + - GITEA__cron.update_checker__RUN_AT_START=true + - GITEA__session__PROVIDER=file + - GITEA__log__MODE=console + - GITEA__log__LEVEL=info + - GITEA__repository.pull-request__DEFAULT_MERGE_STYLE=merge + - GITEA__repository.signing__DEFAULT_TRUST_MODEL=committer + - GITEA__actions__ENABLED=true + - GITEA____APP_NAME="Last2014's Gitea" + - GITEA____RUN_MODE=${RUN_MODE} + volumes: + - ./data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - ${PUBLIC_PORT}:3000 + depends_on: + - db + + db: + image: docker.io/library/postgres:14 + restart: unless-stopped + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=gitea + volumes: + - ./postgres:/var/lib/postgresql/data