diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2025-02-27 09:55:36 +0100 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2025-02-27 11:33:22 -0300 |
| commit | 921b6a28ad4ee754cb561c48aa8a5206a9e6f664 (patch) | |
| tree | 4a54ab4348ef673b0178b48e3d022ba9a6ad46c7 | |
| parent | 9f84d2461cd5daa53e6f925f30eaf1cbf3e6dfcd (diff) | |
| download | luarocks-master.tar.gz luarocks-master.tar.bz2 luarocks-master.zip | |
| -rw-r--r-- | docs/index.md | 3 | ||||
| -rw-r--r-- | docs/local_server.md | 36 |
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 | |||
| 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 | ``` | ||
