Gogs Docker Compose

Emmanuel Gautier / October 30, 2021

Gogs git repositories self-hosting solution docker-compose file

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:9
    volumes:
      - "pg_data:/var/lib/postgresql/data"
    environment:
      POSTGRES_DB: gogs
      POSTGRES_USER: "${POSTGRES_USER}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"

volumes:
  gogs_data:
  pg_data: