Skip to content

Commit abe96d5

Browse files
author
Ubuntu
committed
add dockerfiles
1 parent 854ee9e commit abe96d5

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

Dockerfiles/keydb-latest/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Use the latest KeyDB Docker Image
2+
FROM eqalpha/keydb:latest
3+
# Create module directory and install required additional dependencies for it
4+
RUN mkdir -p /usr/lib/keydb/modules
5+
# Copy over precompiled buster module
6+
COPY modjs.so /usr/lib/keydb/modules
7+
COPY bootstrap.js /usr/lib/keydb/modules
8+
VOLUME /scripts
9+
# Call module to load with keydb-server, specify the config file location
10+
CMD ["keydb-server", "/etc/keydb.conf", "--loadmodule", "/usr/lib/keydb/modules/modjs.so"]

Dockerfiles/redis-latest/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Use the latest Redis Docker Image (Buster)
2+
FROM redis:buster
3+
# Create module directory and install required additional dependencies for it
4+
RUN mkdir -p /usr/lib/keydb/modules
5+
# Copy over precompiled buster module
6+
COPY modjs.so /usr/lib/keydb/modules
7+
COPY bootstrap.js /usr/lib/keydb/modules
8+
VOLUME /scripts
9+
# Call module to load with redis-server
10+
CMD ["redis-server", "--loadmodule", "/usr/lib/keydb/modules/modjs.so"]

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,38 @@ If V8 compiled successfully you are now ready to build ModJS. ModJS can be buil
7979
make V8_PATH=/path/to/v8
8080

8181

82+
## Docker with ModJS
83+
84+
* Visit the official Docker Repository here: [eqalpha/modjs]( https://hub.docker.com/repository/docker/eqalpha/modjs)
85+
* Dockerfiles can be found [here]( https://github.com/JohnSully/ModJS/Dockerfiles)
86+
87+
### Launch a container with ModJS
88+
89+
<b>KeyDB:</b>
90+
```
91+
$ sudo docker run eqalpha/modssl
92+
```
93+
94+
<b>Redis</b>
95+
```
96+
$ sudo docker run eqalpha/modssl:redis-latest
97+
```
98+
99+
<b>Launch container bound to host:</b>
100+
```
101+
$ sudo docker run -p 6379:6379 eqalpha/modssl
102+
```
103+
104+
### Launch with Startup Script
105+
When launching with the docker container you will need to share your script with the docker container by mounting it as a volume to the "scripts" volume in the container:
106+
107+
<b>With Redis:</b>
108+
```
109+
$ sudo docker run -p 6379:6379 -v /path/to/startupjs/vol:/scripts eqalpha/modjs:redis-latest redis-server --loadmodule /usr/lib/keydb/modules/modjs.so /scripts/startup.js
110+
```
111+
112+
<b>With KeyDB:</b>
113+
```
114+
$ sudo docker run -p 6379:6379 -v /path/to/startupjs/vol:/scripts eqalpha/modjs keydb-server /etc/keydb/keydb.conf --loadmodule /usr/lib/keydb/modules/modjs.so /scripts/startup.js
115+
```
116+

0 commit comments

Comments
 (0)