Skip to content

Commit 9fb92ee

Browse files
committed
feat: add Dockerfile for luasandbox
1 parent 36bac38 commit 9fb92ee

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM docker-registry.wikimedia.org/dev/bookworm-php83-fpm:1.0.0 AS build
2+
3+
WORKDIR /src
4+
RUN git clone https://gerrit.wikimedia.org/r/mediawiki/php/luasandbox
5+
RUN apt update && apt install php8.3-dev liblua5.1-0-dev -y
6+
RUN cd luasandbox && phpize && ./configure && make
7+
8+
FROM docker-registry.wikimedia.org/dev/bookworm-php83-fpm:1.0.0
9+
10+
COPY --from=build /src/luasandbox/modules/luasandbox.so /usr/lib/php/20230831/luasandbox.so
11+
RUN echo 'extension=luasandbox.so' > /etc/php/8.3/mods-available/luasandbox.ini && phpenmod luasandbox

features/luasandbox/luasandbox.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# LuaSandbox
2+
3+
docker-compose.override.yml:
4+
5+
```yml
6+
services:
7+
mediawiki:
8+
build:
9+
dockerfile: features/luasandbox/luasandbox.Dockerfile
10+
context: .
11+
```
12+
13+
LocalSettings.php:
14+
```php
15+
$c->Scribunto( $c::SCRIBUNTO_ENGINE_LUASANDBOX );
16+
```
17+
18+
Then run the following commands:
19+
20+
```shell
21+
docker compose --env-file config/.env -p main build mediawiki
22+
mwutil recreate
23+
```

features/profiling/profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ docker-compose.override.yml:
66
services:
77
mediawiki:
88
build:
9-
dockerfile: docker/profiling.Dockerfile
9+
dockerfile: features/profiling/profiling.Dockerfile
1010
context: .
1111
```
1212

0 commit comments

Comments
 (0)