mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
gitea dockerfile
This commit is contained in:
parent
69289bdb87
commit
e1db432235
@ -1,15 +1,15 @@
|
|||||||
APP_NAME=gitea
|
APP_NAME=gitea
|
||||||
APP_VERSION=latest
|
APP_VERSION=1.20.4
|
||||||
# port, APP_PORT is need at leaset
|
# port, APP_PORT is need at leaset
|
||||||
APP_HTTP_PORT=3000
|
APP_HTTP_PORT=3000
|
||||||
APP_NETWORK=websoft9
|
APP_NETWORK=websoft9
|
||||||
APP_URL=119.8.96.66
|
APP_URL=example
|
||||||
|
|
||||||
INSTALL_LOCK=true
|
INSTALL_LOCK=true
|
||||||
DISABLE_SSH=true
|
DISABLE_SSH=true
|
||||||
DISABLE_REGISTRATION=true
|
DISABLE_REGISTRATION=true
|
||||||
RUN_MODE=prod
|
RUN_MODE=prod
|
||||||
HTTP_PORT = 3000
|
HTTP_PORT=3000
|
||||||
DOMAIN=$APP_URL
|
DOMAIN=$APP_URL
|
||||||
SSH_DOMAIN=$APP_URL
|
SSH_DOMAIN=$APP_URL
|
||||||
ROOT_URL=http://$APP_URL:$HTTP_PORT
|
ROOT_URL=http://$APP_URL:$HTTP_PORT
|
||||||
|
@ -1 +1,16 @@
|
|||||||
FROM gitea/gitea:latest
|
# step1: build hook-api exe
|
||||||
|
FROM docker.io/library/golang:1.21-alpine3.18 as build-hook
|
||||||
|
WORKDIR /
|
||||||
|
COPY hook.go /
|
||||||
|
RUN go build -o hook /hook.go
|
||||||
|
|
||||||
|
# step2: from gitea image clone library, copy hook, s6 run script ...
|
||||||
|
FROM gitea/gitea:1.20.4
|
||||||
|
RUN git clone --depth=1 https://github.com/Websoft9/docker-library.git \
|
||||||
|
&& mv docker-library library \
|
||||||
|
&& cp -r library / \
|
||||||
|
&& rm -rf library
|
||||||
|
COPY --from=build-hook /hook /usr/local/bin/hook
|
||||||
|
|
||||||
|
COPY hook /etc/s6
|
||||||
|
RUN chmod -R 755 /etc/s6/hook
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
# image: https://hub.docker.com/r/gitea/gitea
|
# image: https://hub.docker.com/r/gitea/gitea
|
||||||
# docs: https://docs.gitea.io/zh-cn/install-with-docker
|
# docs: https://docs.gitea.io/zh-cn/install-with-docker
|
||||||
|
# gitea admin user create --admin --username websoft9 --random-password --email help@websoft9.com
|
||||||
|
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
gitea:
|
gitea:
|
||||||
image: gitea/gitea:$APP_VERSION
|
|
||||||
container_name: $APP_NAME
|
container_name: $APP_NAME
|
||||||
environment:
|
image: websoft9dev/portainer:1.20.4
|
||||||
- USER_UID=1000
|
build:
|
||||||
- USER_GID=1000
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
26
docker/w9gitea/hook.go
Normal file
26
docker/w9gitea/hook.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", handleRequest)
|
||||||
|
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleRequest(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// 打印请求行和头部信息
|
||||||
|
requestDump, err := httputil.DumpRequest(r, true)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Error dumping request:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Println(string(requestDump))
|
||||||
|
|
||||||
|
log.Println("-----------------------接口被调用了一次!---------")
|
||||||
|
fmt.Fprintf(w, "--Hello, World!")
|
||||||
|
}
|
5
docker/w9gitea/hook/run
Normal file
5
docker/w9gitea/hook/run
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
pushd /root >/dev/null
|
||||||
|
exec su-exec $USER /usr/local/bin/hook
|
||||||
|
popd
|
98
docker/w9gitea/src/config/app.ini.example
Normal file
98
docker/w9gitea/src/config/app.ini.example
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
APP_NAME = gitea
|
||||||
|
RUN_MODE = prod
|
||||||
|
RUN_USER = git
|
||||||
|
WORK_PATH = /data/gitea
|
||||||
|
|
||||||
|
[repository]
|
||||||
|
ROOT = /data/git/repositories
|
||||||
|
|
||||||
|
[repository.local]
|
||||||
|
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
|
||||||
|
|
||||||
|
[repository.upload]
|
||||||
|
TEMP_PATH = /data/gitea/uploads
|
||||||
|
|
||||||
|
[server]
|
||||||
|
APP_DATA_PATH = /data/gitea
|
||||||
|
DOMAIN = 119.8.96.66
|
||||||
|
SSH_DOMAIN = 119.8.96.66
|
||||||
|
HTTP_PORT = 3000
|
||||||
|
ROOT_URL = http://119.8.96.66:3000/
|
||||||
|
DISABLE_SSH = true
|
||||||
|
SSH_PORT = 22
|
||||||
|
SSH_LISTEN_PORT = 22
|
||||||
|
LFS_START_SERVER = true
|
||||||
|
LFS_JWT_SECRET = prcv5KuvKilAB_369Vr4saJf4QBdlMwD-vOXD2l7IHo
|
||||||
|
OFFLINE_MODE = false
|
||||||
|
|
||||||
|
[database]
|
||||||
|
PATH = /data/gitea/gitea.db
|
||||||
|
DB_TYPE = sqlite3
|
||||||
|
HOST = localhost:3306
|
||||||
|
NAME = gitea
|
||||||
|
USER = root
|
||||||
|
PASSWD =
|
||||||
|
LOG_SQL = false
|
||||||
|
SCHEMA =
|
||||||
|
SSL_MODE = disable
|
||||||
|
|
||||||
|
[indexer]
|
||||||
|
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
||||||
|
|
||||||
|
[session]
|
||||||
|
PROVIDER_CONFIG = /data/gitea/sessions
|
||||||
|
PROVIDER = file
|
||||||
|
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /data/gitea/avatars
|
||||||
|
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
|
||||||
|
|
||||||
|
[attachment]
|
||||||
|
PATH = /data/gitea/attachments
|
||||||
|
|
||||||
|
[log]
|
||||||
|
MODE = console
|
||||||
|
LEVEL = info
|
||||||
|
ROOT_PATH = /data/gitea/log
|
||||||
|
|
||||||
|
[security]
|
||||||
|
INSTALL_LOCK = true
|
||||||
|
SECRET_KEY =
|
||||||
|
REVERSE_PROXY_LIMIT = 1
|
||||||
|
REVERSE_PROXY_TRUSTED_PROXIES = *
|
||||||
|
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2OTQ1NzI0NDN9.kzFr-t0io9M_XQWojbvG20KPiXIZPS2GMadRBgR9xMM
|
||||||
|
PASSWORD_HASH_ALGO = pbkdf2
|
||||||
|
|
||||||
|
[service]
|
||||||
|
DISABLE_REGISTRATION = false
|
||||||
|
REQUIRE_SIGNIN_VIEW = false
|
||||||
|
REGISTER_EMAIL_CONFIRM = false
|
||||||
|
ENABLE_NOTIFY_MAIL = false
|
||||||
|
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
|
||||||
|
ENABLE_CAPTCHA = false
|
||||||
|
DEFAULT_KEEP_EMAIL_PRIVATE = false
|
||||||
|
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
|
||||||
|
DEFAULT_ENABLE_TIMETRACKING = true
|
||||||
|
NO_REPLY_ADDRESS = noreply.119.8.96.66
|
||||||
|
|
||||||
|
[lfs]
|
||||||
|
PATH = /data/git/lfs
|
||||||
|
|
||||||
|
[mailer]
|
||||||
|
ENABLED = false
|
||||||
|
|
||||||
|
[openid]
|
||||||
|
ENABLE_OPENID_SIGNIN = true
|
||||||
|
ENABLE_OPENID_SIGNUP = true
|
||||||
|
|
||||||
|
[cron.update_checker]
|
||||||
|
ENABLED = false
|
||||||
|
|
||||||
|
[repository.pull-request]
|
||||||
|
DEFAULT_MERGE_STYLE = merge
|
||||||
|
|
||||||
|
[repository.signing]
|
||||||
|
DEFAULT_TRUST_MODEL = committer
|
||||||
|
|
||||||
|
[oauth2]
|
||||||
|
JWT_SECRET = vIGxNkS5o0NYgDZwxMIcS_zXbbN3GBLCTO5MseHgO8Q
|
Loading…
Reference in New Issue
Block a user