You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Glenn 96689f9c30
doc: Fix typo in deploy command
1 month ago
Dockerfile Bump version 1 month ago doc: Fix typo in deploy command 1 month ago
docker-compose.yml Initial import 6 months ago
entrypoint-wrapper Fix typo 6 months ago
parse-database-url Fix env variables 6 months ago


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

Setup Storage

dokku storage:mount /etc/localtime:/etc/localtime:ro
dokku storage:mount /etc/timezone:/etc/timezone:ro
dokku storage:mount /home/data/code.forgejo/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


git remote add dokku
git push

Create Wrapper

Add git user on host

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/forgejo with the following content

# 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 $@"