Advanced: In-house GIN service

Contents

  1. Set up GIN in your lab
  2. Set up GIN with Docker
  3. Update GIN-Web
  4. Is Docker good for production
  5. Which database backend should I use

Set up GIN in your lab

If you plan to set up a GIN Server in your own lab, you are more than welcome to do so. All our software is based on open source projects and therefore meant to be used, extended and modified by others. The features we implemented on top of gogs are available on Github.

Should you have problems or questions in the process, contact us at gin@g-node.org. Even if you have no trouble, we would love to receive your feedback or just learn from you that you have just setup your own GIN!

NOTE: We're preparing a slightly modified version that's more suitable for in-lab (local) installations and will be available in the future.

Set up GIN with Docker

The easiest way to set up a GIN server is via pre-built docker containers. You will need a working Docker installation. Find instructions here. Furthermore, a dockerhub account is useful.

You start by downloading the docker image for GIN by typing:

docker pull gnode/gin-web:live

The live tag is the most recent stable version, which is the one we run on our servers.

The latest tag is the development version and usually contains untested features which might not work properly.

You can run GIN with:

docker run -p 3000:3000 -p 2222:22 -d gnode/gin-web

You can now visit the website of your GIN server at port 3000 (see the first -p above) of your local machine (localhost:3000). The ssh part can be reached via port 2222 (see the second -p above). You will be greeted with a setup page which will ask you for all the necessary information.

This will map all data and configuration into the docker container, which is fine for playing around. However, should you want to use the server for data it's probably not what you want. Instead, we probably want to map the data as well as the config and log files into some folder of your local host:

docker run -v /somefolder/:/data -p 3000:3000 -p 2222:22 -d gnode/gin-web

This will map the data, configs and such into a folder on your machine (please change "somefolder" accordingly).

If you want the container to run the web service with another user and group id than 1000, you can do this by setting the corresponding environment variables on docker by running:

docker run -v /somefolder/:/data -p 3000:3000 -p 2222:22 -e GITUID="1001" -e GITGID="1001" -d gnode/gin-web

where GITUID and GITGID are followed by the numerical user and group ids respectively.

Update gin-web

To update an existing GIN docker installation you just need to pull in the changes:

docker pull gnode/gin-web

afterward, you stop the running instance with:

docker stop <containername>

<containername> can be determined with:

docker ps

After that you can start a new version using the same command that you started the original docker container with, e.g.:

docker run -v /somefolder/:/data -p 3000:3000 -p 2222:22 -d gnode/gin-web

Which database backend should I use

It's maybe not the best idea to run a multi-multi-user version using SQLite but for a lab use case it should actually be fine. For a larger audience, using a Postgres server (which you can also run with docker) is our recommendation. In such a cases, an advanced file system including proper backup and maybe deduplication, at least for the repositories, should also be considered. In any case, feel free to contact us for assistance.

Further reading

Since GIN is based on GOGS, the official documentation for running GOGS in a container is also relevant: Docker for GOGS

M. Sonntag edited this page 2 years ago