.yml
YAML
(text/x-yaml)
version: "3.3"
services:
  caddy:
    restart: always
    image: "caddy:latest"
    container_name: gitfoss_caddy
    networks:
      - reverse-proxy-public
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./data/caddy/data:/data
      - ./data/caddy/config:/config
  db:
    restart: always
    container_name: gitfoss_db
    image: "postgres:14"
    environment:
      - POSTGRES_PASSWORD=change_me_password
      - POSTGRES_DB=gitfoss
    networks:
      - internal
    volumes:
      - ./data/postgres_data:/var/lib/postgresql/data
  web:
    restart: always
    image: "gitfoss_web:latest"
    container_name: gitfoss_web
    depends_on:
      - db
    environment:
      - COOKIE_NAME=gitfoss_ssid
      - COOKIE_SECRET=change_me_cookie_secret
      - DATABASE_URL=postgresql://postgres:change_me_password@gitfoss_db/gitfoss?sslmode=disable&connection_limit=3
      - DEPLOYMENT_DOMAIN=${DOMAIN:-gitfoss.dev}
      - DEPLOYMENT_SCHEME=https
      - GIT_REPOSITORIES_ROOT=/var/lib/gitfoss/repos
      - PORT=1337
    networks:
      - internal
      - reverse-proxy-public
    volumes:
      - ./data/gitfoss_repos:/var/lib/gitfoss/repos
      #- /home/git/repos:/var/lib/gitfoss/repos

networks:
  internal:
  reverse-proxy-public: