60 lines
1.5 KiB
Nix
60 lines
1.5 KiB
Nix
|
{pkgs, ...}: {
|
||
|
project.name = "git";
|
||
|
|
||
|
networks.dmz = {
|
||
|
name = "dmz";
|
||
|
external = true;
|
||
|
};
|
||
|
|
||
|
networks.transport = {};
|
||
|
|
||
|
services = {
|
||
|
forgejo.service = {
|
||
|
image = "codeberg.org/forgejo/forgejo:1.21.6-0";
|
||
|
container_name = "forgejo";
|
||
|
useHostStore = true;
|
||
|
labels = {
|
||
|
"traefik.enable" = "true";
|
||
|
"traefik.http.routers.forgejo.entrypoints" = "websecure";
|
||
|
"traefik.http.routers.forgejo.rule" = "Host(`git.ghoscht.com`)";
|
||
|
"traefik.http.services.forgejo.loadbalancer.server.port" = "3000";
|
||
|
"traefik.docker.network" = "dmz";
|
||
|
"traefik.http.routers.forgejo.tls" = "true";
|
||
|
"traefik.http.routers.forgejo.tls.certresolver" = "letsencrypt";
|
||
|
};
|
||
|
volumes = [
|
||
|
"/home/ghoscht/.docker/git/forgejo_data:/data"
|
||
|
"/etc/localtime:/etc/localtime:ro"
|
||
|
];
|
||
|
ports = [
|
||
|
"2222:22"
|
||
|
];
|
||
|
environment = {
|
||
|
USER_UID = 1000;
|
||
|
USER_GID = 1000;
|
||
|
GITEA__database__DB_TYPE = "postgres";
|
||
|
GITEA__database__HOST = "db:5432";
|
||
|
};
|
||
|
env_file = [
|
||
|
"/home/ghoscht/.docker/git/forgejo.env"
|
||
|
];
|
||
|
restart = "unless-stopped";
|
||
|
networks = [
|
||
|
"dmz"
|
||
|
"transport"
|
||
|
];
|
||
|
};
|
||
|
db.service = {
|
||
|
image = "postgres:15.3-bullseye";
|
||
|
env_file = [
|
||
|
"/home/ghoscht/.docker/git/forgejo-db.env"
|
||
|
];
|
||
|
volumes = ["/home/ghoscht/.docker/git/forgejo_db:/var/lib/postgresql/data"];
|
||
|
restart = "unless-stopped";
|
||
|
networks = [
|
||
|
"transport"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|