mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-24 03:31:23 +02:00
docker: add base umami config
This is the start of using docker containers for the server services as opposed to using NixOS modules. In a future commit APP_SECRET will be changed to not expose the actual secret.
This commit is contained in:
parent
c9fe3ee590
commit
9361828638
72
home/docker.nix
Normal file
72
home/docker.nix
Normal file
@ -0,0 +1,72 @@
|
||||
let
|
||||
inherit (builtins) toJSON;
|
||||
in
|
||||
{
|
||||
xdg.configFile."docker/compose.yml".text = toJSON {
|
||||
services = {
|
||||
umami = {
|
||||
image = "ghcr.io/umami-software/umami:postgresql-latest";
|
||||
container_name = "umami";
|
||||
restart = "always";
|
||||
|
||||
ports = [
|
||||
"3000:3000"
|
||||
];
|
||||
|
||||
environment = {
|
||||
DATABASE_URL = "postgresql://umami:umami@umami-postgres:5432/umami";
|
||||
DATABASE_TYPE = "postgresql";
|
||||
APP_SECRET = "replace-me-with-a-random-string";
|
||||
};
|
||||
|
||||
depends_on = {
|
||||
umami-postgres = {
|
||||
condition = "service_healthy";
|
||||
};
|
||||
};
|
||||
|
||||
healthcheck = {
|
||||
test = [
|
||||
"CMD-SHELL"
|
||||
"curl http://localhost:3000/api/heartbeat"
|
||||
];
|
||||
|
||||
interval = "5s";
|
||||
timeout = "5s";
|
||||
retries = 5;
|
||||
};
|
||||
};
|
||||
|
||||
umami-postgres = {
|
||||
image = "postgres:17-alpine";
|
||||
container_name = "umami-postgres";
|
||||
restart = "always";
|
||||
|
||||
environment = {
|
||||
POSTGRES_DB = "umami";
|
||||
POSTGRES_USER = "umami";
|
||||
POSTGRES_PASSWORD = "umami";
|
||||
};
|
||||
|
||||
volumes = [
|
||||
"umami-postgres:/var/lib/postgresql/data"
|
||||
];
|
||||
|
||||
healthcheck = {
|
||||
test = [
|
||||
"CMD-SHELL"
|
||||
"pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"
|
||||
];
|
||||
|
||||
interval = "5s";
|
||||
timeout = "5s";
|
||||
retries = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
volumes = {
|
||||
umami-postgres = { };
|
||||
};
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user