Modulo de nginx

This commit is contained in:
Cat /dev/Nulo 2022-06-18 12:05:42 -03:00
parent 9453a03815
commit c54d827579
3 changed files with 15 additions and 0 deletions

View file

@ -7,7 +7,12 @@ local function add_mount(mount)
table.insert(mounts, mount)
add_file("/etc/fstab", utils.join_table(mounts, "\n"))
end
local function add_tmpfs(path)
add_mount("tmpfs "..path.." tmpfs defaults,noexec,nosuid 0 0")
mkdir(path)
end
modules.fstab = {
add_mount = add_mount,
add_tmpfs = add_tmpfs,
}

9
modules/nginx.lua Normal file
View file

@ -0,0 +1,9 @@
modules.nginx = {}
add_packages({ "nginx" })
modules.fstab.add_tmpfs("/var/lib/nginx/tmp")
modules.data.add_data_dir("/data/nginx/logs", "/var/log/nginx", "nginx", "nginx")
modules.runit.add_service("nginx", [[#!/bin/sh
exec 2>&1
mkdir /run/nginx || exit 1
exec nginx -g 'daemon off;'
]])

View file

@ -46,6 +46,7 @@ module "kernel"
module "runit"
module "hostname"
module "dhcpcd"
module "nginx"
print("=> Installing and upgrading packages...")
utils.expect_nil(alpine.make_world(root, packages))