77 lines
2.1 KiB
Nix
77 lines
2.1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
helper = import ./lib.nix { inherit config pkgs lib; };
|
|
cfg = config.numbus.services.gitea;
|
|
in
|
|
|
|
helper.mkPodmanService {
|
|
name = "gitea";
|
|
description = "Gitea, your own self-hosted git platform";
|
|
defaultPort = "3000";
|
|
pod = "gitea";
|
|
dependencies = [ "traefik.service" "${config.numbus.services.dns}.service" ];
|
|
|
|
composeText = ''
|
|
services:
|
|
gitea-server:
|
|
image: docker.gitea.com/gitea:latest-rootless
|
|
container_name: gitea-server
|
|
hostname: gitea-server
|
|
networks:
|
|
gitea_frontend:
|
|
gitea_backend:
|
|
ports:
|
|
- "${cfg.port}:3000/tcp"
|
|
volumes:
|
|
- ${cfg.dataDir}:/var/lib/gitea
|
|
- ${cfg.configDir}:/etc/gitea
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=$POSTGRES_HOST:$POSTGRES_PORT
|
|
- GITEA__database__NAME=$DB_NAME
|
|
- GITEA__database__USER=$DB_USERNAME
|
|
- GITEA__database__PASSWD=$DB_PASSWORD
|
|
- GITEA__server__SSH_PORT=2424
|
|
- GITEA__server__ROOT_URL=${cfg.subdomain}.${config.numbus.services.domain}
|
|
depends_on:
|
|
- gitea-database
|
|
restart: unless-stopped
|
|
|
|
gitea-database:
|
|
image: docker.io/library/postgres:14
|
|
container_name: gitea-database
|
|
hostname: gitea-database
|
|
networks:
|
|
gitea_backend:
|
|
volumes:
|
|
- gitea_database:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_USER=$DB_USERNAME
|
|
- POSTGRES_PASSWORD=$DB_PASSWORD
|
|
- POSTGRES_DB=$DB_NAME
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
gitea_database:
|
|
|
|
networks:
|
|
gitea_frontend:
|
|
name: gitea_frontend
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: "10.89.3.0/24"
|
|
gateway: "10.89.3.254"
|
|
gitea_backend:
|
|
name: gitea_backend
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: "10.89.4.0/24"
|
|
gateway: "10.89.4.254"
|
|
'';
|
|
} |