aboutsummaryrefslogtreecommitdiff
path: root/docs/local_server.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/local_server.md')
-rw-r--r--docs/local_server.md36
1 files changed, 36 insertions, 0 deletions
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```