- Couldn't figure out how to use mounts with
gogs
(there was an odd mix of permissions being used), so you'll have to create some volumes instead.- Volumes > Add Volume (x2)
Name: gogs-backup Name: gogs-data
- Volumes > Add Volume (x2)
- Container > Add Container
Name: git Registry: DockerHub Image: gogs/gogs:0.12.3
- Manual network port publishing
The host port numbers coincide to what I had open (no specific reason for their values). For example, all my local Apps start at the 9000 range, and I usedhost: 8007 -> container: 22 (TCP) host: 9007 -> container: 3000 (TCP)
8007
just to match what I had for the Server's port (minus a 1000). - Advanced Container Settings (section at bottom)
- Volumes
container: /home/git/certs (Bind) host: /media/nfs_lib/_apps/certs (Writable) container: /data (Volume) host: gogs-data (Writable) container: /backup (Volume) host: gogs-backup (Writable)
- Env
IMPORTANT: If you don't set your timezone properly before you go through the installation phase, there's no going back. I tried changing it after the fact, and the Server wouldn't boot afterwards. I eventually just started the Container, went into a shell asName: TZ Value: America/Los_Angeles
root
, and ranrm -rf /data/*
to start fresh. Had to restart the Container after therm -rf
. - Restart Policy:
Unless Stopped
- Volumes
- Manual network port publishing
- Start the Container
- Go to http://<SERVER_IP>:9007 (it should land you on the
/install
page the first time)- These are the settings I changed
Database Type: SQLite3 Application Name: NoxHub Domain: <SERVER_IP> SSH Port: 8007 HTTP Port: 3000 (or you can set it to the forwarded port, and update the above mapping to 'host: 9007 -> container: 9007') Application URL: http://<SERVER_IP>:9007 Optional Settings > Server and Other Services Settings (check) Disable Gravatar Service (uncheck) Enable Captcha
- Click the Install button
- You'll be presented with a login form, choose Create Account
- Fill in your new account credentials, save them, and log in.
- These are the settings I changed
- Once logged in, click on your profile menu > Your Settings > SSH Keys > Add Key >> Add an existing key, or generate a new one and add it.
If you realize that an update is required, you'll need to SSH into the Container since volumes are being used for data.
- Portainer > Containers > git (or your container name) > Console
- Connect as
root
- Connect as
- When reading through the docs, they refer to the
custom
directory a lot. That folder is/data/gogs
while in the Container.vi /data/gogs/conf/app.ini
vim ~/.ssh/config
Host noxhub
Hostname <SERVER_IP>
Port 8007
IdentityFile ~/.ssh/<SSH_FILE> (not .pub)
In order for the config entry to work, you'll have to go into your cloned repo's .git/config
file and update the remote
entry.
[remote "origin"]
- url = ssh://git@<SERVER_IP>:8007/nox/monkey-scripts.git
+ url = ssh://git@noxhub/nox/monkey-scripts.git
You can verify the SSH connection with
ssh -T git@noxhub
- https://github.com/gogs/gogs/tree/main/docker
- gogs/gogs#3039 (comment) (web interface not available after container restart)
- https://github.com/gogs/gogs/tree/main/docker#custom-directory (where is the custom folder)