aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2025-02-27 09:55:36 +0100
committerHisham Muhammad <hisham@gobolinux.org>2025-02-27 11:33:22 -0300
commit921b6a28ad4ee754cb561c48aa8a5206a9e6f664 (patch)
tree4a54ab4348ef673b0178b48e3d022ba9a6ad46c7 /docs
parent9f84d2461cd5daa53e6f925f30eaf1cbf3e6dfcd (diff)
downloadluarocks-master.tar.gz
luarocks-master.tar.bz2
luarocks-master.zip
docs(server): add an example for running a luarocks serverHEADmaster
Diffstat (limited to 'docs')
-rw-r--r--docs/index.md3
-rw-r--r--docs/local_server.md36
2 files changed, 39 insertions, 0 deletions
diff --git a/docs/index.md b/docs/index.md
index 584414ab..075593e7 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -31,6 +31,9 @@
31 * [LuaRocks through a proxy](luarocks_through_a_proxy.md) 31 * [LuaRocks through a proxy](luarocks_through_a_proxy.md)
32 * [Embedding LuaRocks in an application](embedding_luarocks_in_an_application.md) 32 * [Embedding LuaRocks in an application](embedding_luarocks_in_an_application.md)
33 * [Integrating distro modules with LuaRocks](integrating_distro_modules_with_luarocks.md) 33 * [Integrating distro modules with LuaRocks](integrating_distro_modules_with_luarocks.md)
34
35* LuaRocks servers
36 * [Creating a local LuaRocks server](local_server.md)
34 * [Hosting binary rocks](hosting_binary_rocks.md) 37 * [Hosting binary rocks](hosting_binary_rocks.md)
35 38
36* Reference 39* Reference
diff --git a/docs/local_server.md b/docs/local_server.md
new file mode 100644
index 00000000..ae81b226
--- /dev/null
+++ b/docs/local_server.md
@@ -0,0 +1,36 @@
1# Creating a local LuaRocks server
2
3This Docker based example shows how to create a local LuaRocks
4server. This can be used to serve private rocks, or only curated rocks.
5
6The rocks directory is "./rocks" (manifest file will be generated here, so
7it only needs to contain the rock and rockspec files).
8The server will be available at http://localhost:8080
9
10Use LuaRocks with the following flag;
11
12 --server http://localhost:8080
13
14To ONLY use this server (a fully curated approach), use the following flag;
15
16 --only-server http://localhost:8080
17
18
19## Example script:
20```bash
21#!/usr/bin/env bash
22
23# default rocks directory is "./rocks"
24ROCKSDIR=$(pwd)/rocks
25mkdir -p "$ROCKSDIR"
26
27# generate a manifest file
28docker run --rm -v "$ROCKSDIR":/rocks \
29 akorn/luarocks:lua5.1-alpine \
30 luarocks-admin make_manifest /rocks
31
32# start nginx to serve rocks
33docker run --rm --name luarocks-server \
34 -v "$ROCKSDIR":/usr/share/nginx/html:ro \
35 -p 8080:80 nginx
36```