Move gitlab configuration to a networked-docker-container

This commit is contained in:
Tristan Daniël Maat 2020-02-08 21:29:30 +09:00
parent 7266dd3bfa
commit 5b5f922354
Signed by: tlater
GPG key ID: 49670FD774E43268
2 changed files with 21 additions and 23 deletions

View file

@ -12,6 +12,7 @@
# and set inside the docker-containers set, instead of setting the # and set inside the docker-containers set, instead of setting the
# docker-containers set here. # docker-containers set here.
./services/nginx.nix ./services/nginx.nix
./services/gitlab.nix
]; ];
networking = { networking = {
@ -63,12 +64,5 @@
autoPrune.enable = true; autoPrune.enable = true;
}; };
docker-containers = {
## Actual service definitions
gitlab = import ./services/gitlab.nix;
};
};
system.stateVersion = "19.09"; system.stateVersion = "19.09";
} }

View file

@ -1,21 +1,25 @@
{ ... }: { ... }:
{ {
image = "gitlab/gitlab-ce:latest"; networked-docker-containers = {
ports = [ gitlab = {
"3022:22" image = "gitlab/gitlab-ce:latest";
]; ports = [
volumes = [ "3022:22"
"gitlab-data:/var/opt/gitlab:Z" ];
"gitlab-logs:/var/log/gitlab:Z" volumes = [
"gitlab-config:/etc/gitlab:Z" "gitlab-data:/var/opt/gitlab:Z"
]; "gitlab-logs:/var/log/gitlab:Z"
environment = { "gitlab-config:/etc/gitlab:Z"
VIRTUAL_HOST = "gitlab.tlater.net"; ];
LETSENCRYPT_HOST = "gitlab.tlater.net"; environment = {
GITLAB_OMNIBUS_CONFIG = builtins.replaceStrings [ "\n" ] [ "" ] (builtins.readFile ./configs/gitlab.rb); VIRTUAL_HOST = "gitlab.tlater.net";
LETSENCRYPT_HOST = "gitlab.tlater.net";
GITLAB_OMNIBUS_CONFIG = builtins.replaceStrings [ "\n" ] [ "" ] (builtins.readFile ./configs/gitlab.rb);
};
networks = [
"webproxy"
];
};
}; };
extraDockerOptions = [
"--network=webproxy"
];
} }