Become your own DevOp with Gitea and Drone

Have you ever needed to host your own “GitHub“ because of some privacy restrictions of code you have built? Or you do not want to show the entire world your code because of your super cool product and your competitors aren’t sleeping?

I was recently in kind of such a situation. So what do you do? Well I went asking Mr. Google. He then replied with something like “Docker, Gitlab, Drone“.

Luckily I run at home a Synology NAS where I installed the Docker Package. So I tried Gitlab CE but the running Gitlab container took almost all of my 2GB of RAM and some Synology services started to behave laggy.

That was not satisfying to me and I went again searching for something that was more lightweight. And tataaa… I found Gitea.

Gitea - GitHub’s little brother

If you head over to Gitea you very quickly will notice that it almost resembles Github. From a feature view perspective it comes along with all the nitty and gritty features a modern git based developer needs. Gitea also ships with a docker image. You can pull it from the docker hub. It is a very small image only about 77MB. Once you spin it up as a docker container it consumes about 80MB of your RAM. Compared to the Gitlab container a huge RAM saver.

Now with Gitea I have finally a very lightweight source code management system but it comes without any CI/CD features whereas Gitlab has already an integrated one. That’s where I had a look at Drone.io.

Drone - a docker based Continuous Delivery platform

Drone integrates very easily with Gitea and is lightweight as Gitea. It’s concept is completely based on docker which means each time you commit some code it triggers the CI pipeline if configured correctly and takes your project, puts it into a docker container, runs the configured commands like “dotnet restore, dotnet build, dotnet test” and and and… You should know what a CI/CD system is all about.

Docker-Compose for gitea and drone

Below I have a very simple docker-compose file just in case you want to poke around.

version: '3'

services:
  gitea:
    image: gitea/gitea:1.6.3
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - RUN_MODE=prod
    ports:
      - "3000:3000"
    volumes:
      - /<somelocaldir>/gitea/data:/data
    restart: always

  drone:
    image: drone/drone:1.0.0-rc.3
    container_name: drone
    environment:
      - DRONE_GITEA_SERVER=http://gitea:3000/
      - DRONE_GIT_ALWAYS_AUTH=false
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_SERVER_PROTO=http
      - DRONE_SERVER_HOST=<yourserverhost>:3001
      - DRONE_TLS_AUTOCERT=false
    ports:
      - 3001:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /<somelocaldir>/drone/data:/data
    restart: always

So what…

I am very happy with my own little DevOps environment. Ok I agree the term “DevOps” in here is slightly exaggerated but hey, for me DevOps starts here!

What kind of own hosted DevOps environment do you have?

Cheers Thomas

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, see here.