diff options
Diffstat (limited to 'docs/local_server.md')
-rw-r--r-- | docs/local_server.md | 36 |
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 | |||
3 | This Docker based example shows how to create a local LuaRocks | ||
4 | server. This can be used to serve private rocks, or only curated rocks. | ||
5 | |||
6 | The rocks directory is "./rocks" (manifest file will be generated here, so | ||
7 | it only needs to contain the rock and rockspec files). | ||
8 | The server will be available at http://localhost:8080 | ||
9 | |||
10 | Use LuaRocks with the following flag; | ||
11 | |||
12 | --server http://localhost:8080 | ||
13 | |||
14 | To 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" | ||
24 | ROCKSDIR=$(pwd)/rocks | ||
25 | mkdir -p "$ROCKSDIR" | ||
26 | |||
27 | # generate a manifest file | ||
28 | docker run --rm -v "$ROCKSDIR":/rocks \ | ||
29 | akorn/luarocks:lua5.1-alpine \ | ||
30 | luarocks-admin make_manifest /rocks | ||
31 | |||
32 | # start nginx to serve rocks | ||
33 | docker run --rm --name luarocks-server \ | ||
34 | -v "$ROCKSDIR":/usr/share/nginx/html:ro \ | ||
35 | -p 8080:80 nginx | ||
36 | ``` | ||