Gogs Docker Compose

Gogs Docker Compose

Gogs is an open source Git service written in Go. It allows users Git self-hosting to create private and public repositories, and collaborate with others. It is more lightweight than GitLab if you don't need all the Gitlab provide for example.

If you want to use Gogs with Docker locally, you may want to use a docker-compose file. You can find one here:

docker-compose.yml
version: "3"

services:
  gogs:
    image: gogs/gogs
    volumes:
      - "gogs_data:/data"
    ports:
      - "10022:22"
      - "3000:3000"
    links:
      - db
    depends_on:
      - db

  db:
    image: postgres
    volumes:
      - "pg_data:/var/lib/postgresql/data"
    environment:
      POSTGRES_DB: gogs
      POSTGRES_USER: "${POSTGRES_USER}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"

volumes:
  gogs_data:
  pg_data:

Subscribe to the newsletter

Get emails from me about web development and a lot of topics related to tech.