bicep/{postgres,mysql}: bindmount data storage with noatime

This commit is contained in:
h7x4
2026-07-21 21:32:58 +09:00
parent 9a837d210d
commit 4ed1668ac5
2 changed files with 27 additions and 0 deletions
+13
View File
@@ -54,6 +54,18 @@ in
mode = "0700";
};
fileSystems.${dataDir} = lib.mkIf cfg.enable {
device = dataDir;
fsType = "none";
options = [
"bind"
"noatime"
"noauto"
"x-systemd.requires=systemd-tmpfiles-setup.service"
"x-systemd.requires=systemd-tmpfiles-resetup.service"
];
};
systemd.services.mysql = lib.mkIf cfg.enable {
after = [
"systemd-tmpfiles-setup.service"
@@ -61,6 +73,7 @@ in
];
serviceConfig = {
RequiresMountsFor = [ dataDir ];
BindPaths = [ "${dataDir}:${cfg.dataDir}" ];
LogsDirectory = "mysql";