Modulo de nginx
This commit is contained in:
parent
9453a03815
commit
c54d827579
3 changed files with 15 additions and 0 deletions
|
@ -7,7 +7,12 @@ local function add_mount(mount)
|
||||||
table.insert(mounts, mount)
|
table.insert(mounts, mount)
|
||||||
add_file("/etc/fstab", utils.join_table(mounts, "\n"))
|
add_file("/etc/fstab", utils.join_table(mounts, "\n"))
|
||||||
end
|
end
|
||||||
|
local function add_tmpfs(path)
|
||||||
|
add_mount("tmpfs "..path.." tmpfs defaults,noexec,nosuid 0 0")
|
||||||
|
mkdir(path)
|
||||||
|
end
|
||||||
|
|
||||||
modules.fstab = {
|
modules.fstab = {
|
||||||
add_mount = add_mount,
|
add_mount = add_mount,
|
||||||
|
add_tmpfs = add_tmpfs,
|
||||||
}
|
}
|
||||||
|
|
9
modules/nginx.lua
Normal file
9
modules/nginx.lua
Normal 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;'
|
||||||
|
]])
|
|
@ -46,6 +46,7 @@ module "kernel"
|
||||||
module "runit"
|
module "runit"
|
||||||
module "hostname"
|
module "hostname"
|
||||||
module "dhcpcd"
|
module "dhcpcd"
|
||||||
|
module "nginx"
|
||||||
|
|
||||||
print("=> Installing and upgrading packages...")
|
print("=> Installing and upgrading packages...")
|
||||||
utils.expect_nil(alpine.make_world(root, packages))
|
utils.expect_nil(alpine.make_world(root, packages))
|
||||||
|
|
Loading…
Reference in a new issue