Compare commits
2 commits
ae27903247
...
d9b57f51c8
Author | SHA1 | Date | |
---|---|---|---|
d9b57f51c8 | |||
87b10d5f64 |
2 changed files with 59 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
# FROM gitea/gitea:1.16.9
|
||||
FROM gitea/gitea:1.17.0
|
||||
FROM gitea/gitea:1.17.3
|
||||
|
||||
COPY entrypoint-wrapper parse-database-url /usr/bin/
|
||||
RUN chmod 755 /usr/bin/entrypoint-wrapper /usr/bin/parse-database-url
|
||||
|
|
58
README.md
Normal file
58
README.md
Normal file
|
@ -0,0 +1,58 @@
|
|||
|
||||
# Gitea
|
||||
|
||||
## Setup on Dokku
|
||||
|
||||
Define secrets
|
||||
|
||||
$(openssl rand -hex 16)
|
||||
|
||||
Create APP
|
||||
|
||||
dokku apps:create code
|
||||
|
||||
Setup Network & Domains
|
||||
|
||||
dokku network:create cicd_net
|
||||
dokku network:set code attach-post-create cicd_net
|
||||
dokku config:set --no-restart code DOKKU_LETSENCRYPT_EMAIL=username@example.com
|
||||
|
||||
Setup Storage
|
||||
|
||||
dokku storage:mount /etc/localtime:/etc/localtime:ro
|
||||
dokku storage:mount /etc/timezone:/etc/timezone:ro
|
||||
dokku storage:mount /home/data/code.gitea/data:/data
|
||||
dokku storage:mount /home/git/.ssh/:/data/git/.ssh
|
||||
|
||||
Setup Configuration
|
||||
|
||||
dokku config:set code
|
||||
DATABASE_URL: mysql://xxxxx
|
||||
REDIS_URL: redis://xxxxx
|
||||
USER_GID: 1002
|
||||
USER_UID: 1002
|
||||
|
||||
|
||||
Deploy
|
||||
|
||||
git remote add dokku dokku@example.com:cicd
|
||||
git push
|
||||
|
||||
## Create Wrapper
|
||||
|
||||
adduser --disabled-password git
|
||||
adduser git docker
|
||||
|
||||
Create ssh key for git user
|
||||
|
||||
ssh-keygen -t rsa -f /home/git/.ssh/id_rsa -C "Gitea Host Key"
|
||||
chmod 600 /home/git/.ssh/id_rsa
|
||||
|
||||
Create `/usr/local/bin/gitea`
|
||||
|
||||
GITEA_CID=code.web.1
|
||||
# GITEA_IP="$(docker inspect "$GITEA_CID" -f '{{ (index (index .NetworkSettings.Ports "80/tcp") 0).HostPort }}')"
|
||||
GITEA_IP="$(docker inspect "$GITEA_CID" -f '{{ .NetworkSettings.IPAddress }}' 2>/dev/null )"
|
||||
|
||||
ssh -T -p 22 -o StrictHostKeyChecking=no git@$GITEA_IP "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
|
||||
|
Loading…
Add table
Reference in a new issue